in reply to Forking the polite way

It might be worth taking a look at the source to Proc::Daemon which also follows the general rules of daemon processes described by W. Richard Stevens - That is, this module performs the following:

 

perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'

Replies are listed 'Best First'.
Re: Re: Forking the polite way
by rjray (Chaplain) on Feb 13, 2002 at 05:16 UTC

    Thanks for the feedback. I've added the chdir as suggested. It was already clearing the umask and setting itself as a process group leader with setpgrp(). After giving it some thought though, I'm not going to add a use of POSIX because it's just too heavy of a module to saddle someone with. Ditto on closing all files. I am considering having it re-open STDIN, STDOUT and STDERR onto /dev/null, though.

    --rjray