我最初在 StackOverflow 上问过这个问题。然后意识到这可能是一个更好的地方。
我有 bluepill 设置来监控我的 delay_job 进程。(Ruby On Rails 应用程序)
使用 Ubuntu 12.10。
我正在使用 Ubuntu 的upstart. 我的新贵配置如下 ( /etc/init/bluepill.conf)。
description "Start up the bluepill service"
start on runlevel [2]
stop on runlevel [016]
expect daemon
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
Run Code Online (Sandbox Code Playgroud)
我也试过用expect fork代替expect daemon。我也尝试过expect...完全删除该行。
当机器启动时,bluepill 启动正常。
$ ps aux …Run Code Online (Sandbox Code Playgroud)