Re: /etc/rc.d locking devd.pid

From: Kostik Belousov <kostikbel_at_gmail.com>
Date: Mon, 19 Oct 2009 14:29:38 +0300
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.

Received on Mon Oct 19 2009 - 09:30:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:57 UTC