linux – Upstart跟踪错误的Bluepill PID
发布时间:2020-12-14 01:39:55 所属栏目:Linux 来源:网络整理
导读:我有bluepill设置来监控我的delayed_job进程. 使用Ubuntu 12.04. 我正在使用Ubuntu的新贵启动并监控bluepill服务.我的upstart配置如下(/etc/init/bluepill.conf). description "Start up the bluepill service"start on runlevel [2]stop on runlevel [016]e
我有bluepill设置来监控我的delayed_job进程.
使用Ubuntu 12.04. 我正在使用Ubuntu的新贵启动并监控bluepill服务.我的upstart配置如下(/etc/init/bluepill.conf). description "Start up the bluepill service" start on runlevel [2] stop on runlevel [016] expect fork exec sudo /home/deploy/.rvm/wrappers/<app_name>/bluepill load /home/deploy/websites/<app_name>/current/config/server/staging/delayed_job.bluepill # Restart the process if it dies with a signal # or exit code not given by the 'normal exit' stanza. respawn 我也尝试过使用expect守护进程而不是期望fork.我也尝试完全删除expect …行. 当机器启动时,bluepill启动正常. $ps aux | grep blue root 1154 0.6 0.8 206416 17372 ? Sl 21:19 0:00 bluepilld: <app_name> bluepill过程的PID在这里是1154.但新贵似乎正在跟踪错误的PID. $initctl status bluepill bluepill start/running,process 990 如果我使用kill -9强行杀死bluepill,这可以防止bluepill进程重生. 此外,我认为由于跟踪了错误的PID,重新启动/关闭只是挂起而我每次都必须硬重置机器. 这可能是什么问题? 解决方法
显然,新贵跟踪错误的PID.从查看bluepill源代码,它使用守护进程gem来进行守护,然后再进行两次.所以期望upstart配置中的守护进程应该跟踪正确的PID – 但是你已经尝试过了.
如果你有可能,你应该在前台运行bluepill,而不要在你的upstart配置中使用任何期望的节. 从bluepill文档: Bluepill.application("app_name",:foreground => true) do |app| # ... end 将在前台运行bluepill. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |