in reply to Re : A perl daemon
in thread A perl daemon
For handling signals, have a look at perlipc, especially the section entitled Handling the SIGHUP Signal in Daemons.
You probably want something like this (untested):
Then to signal the cron daemon, you need it's PID, and you can do:sub reload_cron { my $cron = shift; my $file = shift; $cron->clean_timetable; $cron->load_crontab($file); } { local $SIG{USR1} = sub { reload_cron($cron,$file) }; $cron->run; }
kill $pid,10; # SIGUSR1
Hope this helps>
In Section
Seekers of Perl Wisdom