This feature has been sitting on the backburner for too long. Now
you can foreground an application in three ways:
1) At compile-time, use foreground => 1 in your constructor
2) At run-time from the command itself: init.pl foreground
3) At run-time from the environment settings: DC_FOREGROUND=1 init.pl start
This closes#15
This new method allows giving the action as an argument, and returns
the exit code which would have been used. The origional run method
has become a shortcut for this method and remains backwards compatible.
This closes https://github.com/symkat/Daemon-Control/issues/57
Change the check for valid users/groups to check for definiedness
instead of for whether the return value is true. Makes it possible to
run a daemon as root/root.
Searches the `ps` list for anything that looks like the daemon that might
already be running.
Both the program name and arguments are checked, as it appears different
operating systems vary as to how they populate `ps`: On ubuntu, my daemon
looks like:
/path/to/perl /path/to/program args
but on CentOS, the very same code shows up as:
/path/to/program args
* PID file will be deleted on do_stop
* PID file will be created by the target user when ->uid set
* uid() and gid() now take strings as well (doherty)
* Kill signal order changed to TERM TERM INT KILL
* init_config option added, gives LSB script a file to source.
* Typo fixes
* Mike Doherty (doherty) added to contrib (Thank you!)