svn commit: r230869 - head/usr.sbin/daemon
Pawel Jakub Dawidek
pjd at FreeBSD.org
Sun Feb 5 21:48:05 UTC 2012
On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote:
> Ok, using hastd code as a reference :-) here is my implementation.
- I'd not pass selected signals to the child. The parent can still be
killed with a whole bunch of different signals that are not passed or
cannot be caught or the child process handle them gracefully.
Signals should be send to the PID from the pidfile anyway. If someone
is sending signals to the parent he has no right to expect well
behaviour from the parent.
- Now that we handle the pidfile fully in the parent, I'd move dropping
provileges after fork(2) and pidfile_write(3). This way pidfiles will
always be created with root privileges and we can forget about all the
mess with pid directories, etc.
- With the above you can wait for child to exit with simple wait(2).
Pawel Jakub Dawidek http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20120205/8e10fe9e/attachment.pgp
More information about the svn-src-all