Send the SIGHUP signal to a process in Perl

2019-07-26 15:50发布

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条回答
ら.Afraid
2楼-- · 2019-07-26 16:44

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.

查看更多
登录 后发表回答