Skip to content

Instantly share code, notes, and snippets.

@foliosus
Created October 6, 2011 08:28
Show Gist options
  • Save foliosus/1266849 to your computer and use it in GitHub Desktop.
Save foliosus/1266849 to your computer and use it in GitHub Desktop.
Upstart script to run delayed_job, with a weird rvm hack
# /etc/init/delayed_job.conf
# Note that you have to modify script/delayed_job's shebang line to have the correct ruby path
description "Delayed_job for a Rails app"
author "Brent Miller <foliosus@foliosus.com>"
start on started mysql
stop on stopping mysql
respawn
exec su deployer -c '/usr/local/rvm/bin/rvm && cd /home/deployer/app/current && script/delayed_job run RAILS_ENV=production >> /home/deployer/app/current/log/delayed_job.log 2>&1'
# /etc/sudoers.d/restart
# This file needs to be chmod 0440
deployer ALL = (root) NOPASSWD:NOEXEC: /sbin/restart
@foliosus
Copy link
Author

foliosus commented Oct 6, 2011

Store this in /etc/init. Works on Ubuntu 11.04 natty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment