Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
# resque wrapper for monit
# see also http://mmonit.com/wiki/Monit/FAQ#pidfile
usage()
{
echo "usage: ${0} {start|stop} <any_process_keyword>"
exit 1
}
if [ ! $# -eq 2 ]; then
usage
fi
pid_file=/usr/local/app/APPLICATION/shared/pids/resque.${2}.pid
log_file=/usr/local/app/APPLICATION/shared/log/resque.${2}.log
case $1 in
start)
echo $$ > ${pid_file}
exec 2>&1 rake resque:work 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
You can’t perform that action at this time.