Skip to content

Instantly share code, notes, and snippets.

@masatomo
Created February 27, 2010 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masatomo/316496 to your computer and use it in GitHub Desktop.
Save masatomo/316496 to your computer and use it in GitHub Desktop.
#!/bin/sh
# resque_scheduler wrapper for monit
# see also http://mmonit.com/wiki/Monit/FAQ#pidfile
usage()
{
echo "usage: ${0} {start|stop}"
exit 1
}
if [ ! $# -eq 1 ]; then
usage
fi
pid_file=/usr/local/app/APPLICATION/shared/pids/resque_scheduler.pid
log_file=/usr/local/app/APPLICATION/shared/log/resque_scheduler.log
case $1 in
start)
echo $$ > ${pid_file}
exec 2>&1 rake resque:scheduler 1> ${log_file}
;;
stop)
kill `cat ${pid_file}`
;;
*)
usage
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment