in reply to Re: Fork daemon from Perl script and save it's PID. How to do it right?
in thread Fork daemon from Perl script and save it's PID. How to do it right?
Yeah, usually daemon is able to save its pid into file, also many of them allow to specify name of the pid file as comand line option, e.g inetd -p /var/run/inetd.pid. So you can create temporary file using File::Temp, fork and exec daemon with such option, so you can run multiple instances of daemon and each will use its own pid file.
Another approach is to use option that prevents daemon from forking if it has one.
|
|---|