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

Mikolaj Golub trociny at freebsd.org
Wed Feb 8 08:32:49 UTC 2012


On Mon, 6 Feb 2012 23:17:43 +0100 Pawel Jakub Dawidek wrote:

 PJD> On Mon, Feb 06, 2012 at 11:46:24PM +0200, Mikolaj Golub wrote:

 >> Thanks. The updated version is attached.

 PJD> Looks good to me.

Thanks. But I still think that adding some signal handling is a good idea. I
agree that there may be no sense in trying to handle many different signals,
but handling SIGTERM (software termination signal :-) nicely looks like a good
thing.

This would solve problems like stale pid files after shutdown or orphaned
programs (again with stale pid files and a possibility to start another
instance) due to a user mistakenly terminated the supervising daemons.

Also it is possible then to add "automatic restart" option, as Andrey has
proposed.

Here is the patch that does it. It also change proctitle to make identifying a
a supervisor with its charge.

On the other hand not being an active user of daemon(8) utility, I don't have
a strong opinion and would like to see what other people, especially those who
use it, think about this.

A technical question concerning the patch :-). Does sombody know if
sigwaitinfo() may be interrupted in my case and I should check for EINTR, as I
do in the patch?

-- 
Mikolaj Golub

-------------- next part --------------
A non-text attachment was scrubbed...
Name: daemon.c.3.patch
Type: text/x-diff
Size: 5090 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20120208/dfb9bc48/daemon.c.3.bin


More information about the svn-src-all mailing list