I have an upstart service to start bluepill (Ruby gem to monitor processes). The upstart config is below.
description "Start up the bluepill service"
start on runlevel [2]
stop on runlevel [016]
exec sudo /home/deploy/.rvm/wrappers/<app_name>/bluepill load /home/deploy/websites/<app_name>/current/config/server/staging/delayed_job.bluepill
I want bluepill to be started as root.
All upstart configs are run as root, when the machine boots, right? So, no sudo
should be needed in the upstart config's exec
line.
The above script works just fine, and bluepill starts on system boot. But if I remove the sudo
on the exec
line, bluepill does not start on system boot. Looking at the log, it seems like bluepill is starting as a non-privileged user and thus fails.
Can anybody explain why?
I don't want sudo
to be used, because, when I give respawn
, upstart tracks the PID of the sudo
process and not the PID of the actual bluepill process.