I originally asked this question on StackOverflow. Then realised that this is probably a better place.
I have bluepill setup to monitor my delayed_job processes. (Ruby On Rails application)
Using Ubuntu 12.10.
I am starting and monitoring the bluepill service itself using Ubuntu's
upstart. My upstart config is below (
description "Start up the bluepill service" start on runlevel  stop on runlevel  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
I have also tried with
expect fork instead of
expect daemon. I have also tried removing the
expect... line completely.
When the machine boots, bluepill starts up fine.
$ ps aux | grep blue root 1154 0.6 0.8 206416 17372 ? Sl 21:19 0:00 bluepilld: <app_name>
The PID of the bluepill process is 1154 here. But
upstart seems to be tracking the wrong PID. It is tracking a PID which does not exist.
$ initctl status bluepill bluepill start/running, process 990
I think it is tracking the PID of the
sudo process which started the bluepill process.
This is preventing the bluepill process from getting respawned if I forcefully kill bluepill using
Moreover, I think because of the wrong PID being tracked, reboot / shutdown just hangs and I have to hard reset the machine every time.
What could be the issue here?