Skip to content

Instantly share code, notes, and snippets.

@SergeyKishenin
Forked from dgilperez/delayed_job
Created October 19, 2013 21:18
Show Gist options
  • Save SergeyKishenin/7061711 to your computer and use it in GitHub Desktop.
Save SergeyKishenin/7061711 to your computer and use it in GitHub Desktop.
#!/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