Skip to content

Instantly share code, notes, and snippets.

@itsprdp
Created February 13, 2015 12:19
Show Gist options
  • Save itsprdp/0f33c0ad6668defad80f to your computer and use it in GitHub Desktop.
Save itsprdp/0f33c0ad6668defad80f to your computer and use it in GitHub Desktop.
Delayed Job Upstart Script (Capistrano)
# Ubuntu upstart file at /etc/init/service.conf
pre-start script
mkdir -p /var/log/"#{fetch: application_name}"/
end script
respawn
respawn limit 15 5
start on runlevel [2345]
stop on runlevel [06]
script
su - "#{fetch: user}" -c "RAILS_ENV=#{Rails.env} bundle exec bin/delayed_job start > 2>&1" >> /var/log/"#{fetch: application_name}"/delayed_job.log
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment