From owner-freebsd-current@FreeBSD.ORG Wed Nov 11 23:54:42 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A093D1065679 for ; Wed, 11 Nov 2009 23:54:42 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 56F708FC1A for ; Wed, 11 Nov 2009 23:54:42 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.3/8.14.3) with ESMTP id nABNsd5I069585; Wed, 11 Nov 2009 16:54:39 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.3/8.14.3/Submit) with ESMTP id nABNsdr6069582; Wed, 11 Nov 2009 16:54:39 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Wed, 11 Nov 2009 16:54:39 -0700 (MST) From: Warren Block To: Kostik Belousov In-Reply-To: Message-ID: References: <20091018220935.GR2160@deviant.kiev.zoral.com.ua> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (wonkity.com [127.0.0.1]); Wed, 11 Nov 2009 16:54:40 -0700 (MST) Cc: =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= , current@freebsd.org Subject: Re: /etc/rc.d locking devd.pid (was Re: Restarting devd) 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: Wed, 11 Nov 2009 23:54:42 -0000 On Sun, 18 Oct 2009, Warren Block wrote: > On Mon, 19 Oct 2009, Kostik Belousov wrote: >>> >>> ...and this is due to dhclient, run from /etc/rc.d at startup, locking >>> /var/run/devd.pid: >>> >>> lightning% lsof /var/run/devd.pid >>> COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME >>> devd 400 root 6w VREG 0,101 3 47124 /var/run/devd.pid >>> dhclient 865 root 6w VREG 0,101 3 47124 /var/run/devd.pid >>> dhclient 1024 _dhcp 6w VREG 0,101 3 47124 /var/run/devd.pid >>> >>> This is a regression from 7-STABLE, where devd.pid is only locked by >>> devd after startup. >> >> Devd forks to spawn dhclient, it seems, and opened file descriptor for >> the lock file is leaking to the child. Since pidfile(3) uses flock(2), >> the lock survives devd death. >> >> I think that this is a generic issue with pidfile/fork interaction. >> It is not obvious whether setting FD_CLOEXEC flag is right thing to >> do there. (And that didn't fix it, but information included for completeness.) I've entered PR bin/140462 for this. -Warren Block * Rapid City, South Dakota USA