将SIGHUP信号发送到Perl中的进程 [英] Send the SIGHUP signal to a process in Perl
问题描述
我有一个UNIX守护程序,它等待SIGHUP刷新数据.我尝试通过Proc :: Killall("killall('HUP','mydaemon');")从Perl脚本(在同一服务器上的Apache www-data:www-data下)发送信号,但是我没有适当的权限. suid位也不起作用.来自外壳的'kill -n HUP'正在工作.
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.
您有这样做的主意吗?
推荐答案
The usual work-around is to employ a »touch file« to indicate a reload, see Apache2::Reload for a real life example.
收听使用设置的通知 File :: ChangeNotify 或
Listen to notifications set up with e.g. File::ChangeNotify or AnyEvent::Inotify::Simple, then do your reloading.
这篇关于将SIGHUP信号发送到Perl中的进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!