From owner-freebsd-current@FreeBSD.ORG Mon Jun 28 16:57:43 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C74B5106564A; Mon, 28 Jun 2010 16:57:43 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6D5798FC0C; Mon, 28 Jun 2010 16:57:43 +0000 (UTC) Received: by gxk7 with SMTP id 7so586496gxk.13 for ; Mon, 28 Jun 2010 09:57:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=2AsINbkrR+f015CVw4S8kUSFHvK54hSQuw22RZ8zev4=; b=L17tWIMvRyQ85uWxTCFkVOKYPPsLa9phisMg32p6TZTdptcZRKKSiaDKn/YnR/VZW9 H926a2wwRQJmDHpwBFWUsnX8QDnkhNYdlgO+foiqkbirp/XkhJwFsuQZATRwh/nRHz2a yASVeuYjTimfdeSjo0UeVMeljBPl6zm8wmC0s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=aoHJxHWDtfUc4Nu5lowaHlhdDt9zWZArSldQ+b2YAzLuJjMX0iEAUfNiDvnqhbSWmF g8LWsGguHntkitjMdK4zjlbUcNuW+G4E4wOKKIwxkvsivyH2KeIF5jhPJ7aaVmSNvF+6 gITYWl1s09kuGtX3/7WfTKv9H4o9S2E7fTW7k= MIME-Version: 1.0 Received: by 10.229.184.132 with SMTP id ck4mr2834946qcb.31.1277744257513; Mon, 28 Jun 2010 09:57:37 -0700 (PDT) Received: by 10.229.80.75 with HTTP; Mon, 28 Jun 2010 09:57:37 -0700 (PDT) In-Reply-To: <86pqzb5io7.fsf@ds4.des.no> References: <20100627.201716.1108826596298620201.imp@bsdimp.com> <86iq537egy.fsf@ds4.des.no> <20100628.081810.502133560696912792.imp@bsdimp.com> <86pqzb5io7.fsf@ds4.des.no> Date: Mon, 28 Jun 2010 09:57:37 -0700 Message-ID: From: Garrett Cooper To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, pjd@freebsd.org, "M. Warner Losh" , hselasky@c2i.net Subject: Re: Patch for rc.d/devd on FreeBSD 9-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2010 16:57:43 -0000 2010/6/28 Dag-Erling Sm=F8rgrav : > "M. Warner Losh" writes: >> Dag-Erling Sm=F8rgrav writes: >> > "M. Warner Losh" writes: >> > > Maybe the real problem is that devd locks the file, then dies. =A0Th= e >> > > file remains locked, so the flopen is failing with EWOULDBLOCK. >> > The lock is released when the process that holds it terminates. >> So which process is that? =A0devd took it out, and is subsequently >> killed. =A0When it restarts, it can't take out the lock. > > What does fstat say about the pid file? > >> The same code works perfectly in 8.0-stable from April. >> >> The conclusion, I believe, is that somebody broke locking in >> current... > > Before I wrote one of my earlier replies, I traced through the code > paths that lead to a lock being released, and everything looks fine and > dandy. =A0Besides, if someone had, as you suggest, broken locking in > current, there would be a lot more noise about it on the lists. Hi DES, When I do the following: /etc/rc.d/devd start /etc/rc.d/devd stop It leaves stray unused lockfiles in the directory: $ sudo /etc/rc.d/devd start Starting devd. $ ls -l /var/run/devd.pi* -rw------- 1 root wheel 5 Jun 28 09:53 /var/run/devd.pid srw-rw-rw- 1 root wheel 0 Jun 28 09:53 /var/run/devd.pipe $ fstat /var/run/devd.pi* USER CMD PID FD MOUNT INUM MODE SZ|DV R/W NAME root devd 29791 6 /var 447511 -rw------- 5 w /var/run/devd.pid $ sudo /etc/rc.d/devd stop Stopping devd. $ ls -l /var/run/devd.pi* -rw------- 1 root wheel 5 Jun 28 09:52 /var/run/devd.pid srw-rw-rw- 1 root wheel 0 Jun 28 09:52 /var/run/devd.pipe $ fstat /var/run/devd.pi* USER CMD PID FD MOUNT INUM MODE SZ|DV R/W NAME Thanks, -Garrett