Last Updated: February 25, 2016
·
1.265K
· jgonzales11

delayed_job upstart script

Most scripts out there start but do not stop. This is because delayed_job script uses demonize.

The solution is to use the command "run" instead of "start".

# Copy:
# /etc/init/delayed_job.conf
# Execute:
# Change user name!!

description "Start up the delayed_job service"

start on runlevel [2345]
stop on runlevel [06]

script
    exec sudo RAILS_ENV=production -u USERNAME -i /SITE/current/bin/delayed_job run
end script