Created
February 16, 2010 03:37
-
-
Save masatomo/305259 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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