symkat/Daemon-Control — pull request #37 by kromg (2013-02-03 04:38:24+00:00)
Title: Inlineable

Hi,
I have been asked (https://rt.cpan.org/Ticket/Display.html?id=82864) to merge my module Script::Daemonizer with yours, if possible, so I tried to get the same behaviour of my daemonize() method from run().
I moved the exit() to the methods that need it, and also let methods like do_status exit with 1 if process is not running, 0 if it is (this should be standard, AFAIK). If "program =>" is not defined, run() simply calls _fork() or _double_fork() and then returns, instead of exit()-ing (in the parent it prints "Started" and exits, of course).

Please let me know if you're interested in this patch. I was also thinking about having an import tag like :DEFAULTS that could auto-initialize some quantities and behaviours (like, chdir to '/', use $0 as the default name, set umask to 0 and so on). I may implement this.

Thanks.