[Dev] Re: [Dev] Re: simple daemon dies

Peter Long dev@trilug.org
Thu, 30 May 2002 00:25:38 -0400 (EDT)


> Hello
> 
> I thought this would be interesting to those who followed the "Re:
> [Dev] HOWTO write a daemon" thread.
> 
<snip>

Interesting reading. I got my little daemon working in about 1 hour thanks 
to all the advice given here. The only signal I am handling is SIGQUIT. I 
use it to set a flag that causes all the worker threads in my daemon to 
exit. It works perfectly.

I was wondering if there is a template out there showing a reference 
implementation of signal handlers? If seems dangerous to just let the 
default handler handle all signals. Does that not mean SIGTERM would zap 
your process without giving you a chance to free file handles, close 
sockets of whatever?

-- 
Peter Long
mailto:petelong@petelong.com