Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Nov 2009 16:54:39 -0700 (MST)
From:      Warren Block <wblock@wonkity.com>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>, current@freebsd.org
Subject:   Re: /etc/rc.d locking devd.pid (was Re: Restarting devd)
Message-ID:  <alpine.BSF.2.00.0911111647030.69546@wonkity.com>
In-Reply-To: <alpine.BSF.2.00.0910181658400.94482@wonkity.com>
References:  <alpine.BSF.2.00.0910171503010.89326@wonkity.com> <alpine.BSF.2.00.0910181542440.94243@wonkity.com> <20091018220935.GR2160@deviant.kiev.zoral.com.ua> <alpine.BSF.2.00.0910181658400.94482@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0911111647030.69546>