svn commit: r230869 - head/usr.sbin/daemon

Pawel Jakub Dawidek pjd at
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             
FreeBSD committer               
Am I Evil? Yes, I Am!           
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the svn-src-head mailing list