/etc/rc.d locking devd.pid

Kostik Belousov kostikbel at gmail.com
Mon Oct 19 11:30:14 UTC 2009


On Mon, Oct 19, 2009 at 09:42:51AM +0200, Dag-Erling Sm??rgrav wrote:
> Kostik Belousov <kostikbel at gmail.com> writes:
> > 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.
> 
> Most certainly not.
Why ? We definitely leak file descriptor on exec(2) unless daemon
explicitely closes it after fork. I said that it is unobvious is it
right to enforce FD_CLOEXEC unconditionally, because some daemons
exec() itself to reinitialize.

> 
> > Anyway, please test.
> 
> Please read flopen.c's revision history.
I am aware of flock->fcntl->flock story, but it is relevant to fork(2),
not to the exec(2) issues.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20091019/3995da1d/attachment.pgp


More information about the freebsd-current mailing list