On Mon, Feb 06, 2012 at 08:31:47AM -0600, Guy Helmer wrote: > If my understanding of flock(2) semantics is correct, with open(2) O_CLOEXEC > or fcntl(2) FD_CLOEXEC set on the pidfile, the closing of the pidfile file > descriptor during an exec will result in loss of the lock on the pidfile > regardless of whether daemon(8) hangs around to wait for the child exit.
My expectation is that as long as parent process holds pidfile descriptor open and locked, the pidfile should remain locked even after fork(2)/execve(2). Worth checking, though. -- Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl
pgpMtLJPjhHTB.pgp
Description: PGP signature