I have a Raspberry Pi where I set the time via a perl-script from a tv-stick.
The script run as an init-script via Daemon::Control and looks like this:
Now the thing is that while it works (time is set, log message appears in syslog), the pid-file does not get deleted, even though the script has done it's thing and has exited.use strict; use Daemon::Control; use Sys::Syslog; exit Daemon::Control->new( name => "Time from DVB", lsb_start => '$syslog $remote_fs', program => \&time_from_dvb, pid_file => "/tmp/dvb-perl.pid", )->run; sub time_from_dvb { openlog("perl-mh"); # set the time from dvb syslog("time set"); }
I would have assumed that Daemon::Control would see to the pid-file being deleted once the program (in my case a subroutine) has finished.
Is that a wrong understanding of how Daemon::Control works or is there anything else I have to do for the pid-file to get removed?
Many thanks!
In reply to Daemon::Control pid-files by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |