Have a look at daemontools. Essentially, daemontools take care of start, stop, restart, logging, sending signals, "becoming a daemon". You don't have to reinvent all of this. Just write the code that "does the job". Send log output to STDOUT or STDERR. Don't fork background processes.
The concept of daemontools is often copied, you can find a very similar implementation in runit standalone and in busybox, systemd also expect daemons to run under its control, so does upstart.
All of these systems need extra work for daemons that fork themselves to the "background". Even a classic init that controls a daemon expect it not to fork to "background". The "going to background" is only really meaningful when starting daemons manually from a (virtual) terminal or the console, and there, a small shell script using kill, fork, exec, nohup and i/o redirection makes much more sense. This script can also be used from classic init scripts.
Alexander
In reply to Re: A few questions regarding Proc::Daemon
by afoken
in thread A few questions regarding Proc::Daemon
by walkingthecow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |