Skip to content

Instantly share code, notes, and snippets.

@dgilperez
Created July 3, 2012 18:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dgilperez/3041630 to your computer and use it in GitHub Desktop.
Save dgilperez/3041630 to your computer and use it in GitHub Desktop.
Delayed_job init script for linux
#!/bin/sh
set_path="cd /home/rails/my_app/current"
case "$1" in
start)
echo -n "Starting delayed_job: "
su - rails -c "$set_path; RAILS_ENV=production script/delayed_job start" >> log/delayed_job.log 2>&1
echo "done."
;;
stop)
echo -n "Stopping sphinx: "
su - rails -c "$set_path; RAILS_ENV=production script/delayed_job stop" >> log/delayed_job.log 2>&1
echo "done."
;;
*)
N=/etc/init.d/delayed_job
echo "Usage: $N {start|stop}" >&2
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment