将SIGHUP信号发送到Perl中的进程 [英] Send the SIGHUP signal to a process in Perl

查看:166
本文介绍了将SIGHUP信号发送到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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆