Send the SIGHUP signal to a process in Perl

2019-07-26 16:48发布

问题:

I have a UNIX daemon, which wait of SIGHUP for refresh a data. I try to send a signal from the Perl script (under Apache www-data:www-data on the same server) by Proc::Killall ("killall('HUP', 'mydaemon');"), but I have no properly permissions. suid bit doesn't work too. 'kill -n HUP ' from shell are working.

Does you have any idea to do this?

回答1:

The usual work-around is to employ a »touch file« to indicate a reload, see Apache2::Reload for a real life example.

Listen to notifications set up with e.g. File::ChangeNotify or AnyEvent::Inotify::Simple, then do your reloading.