php-resque/extras/resque.monit
Chris Boulton 2f5b48930f make better use of composer across php-resque
* recommend php-resque be installed via Composer
* provide quick getting started steps
* move ./resque.php to bin/resque, make it available as a Composer bin
* have classes autoloaded via Composer (or some other means if not using Composer)
2013-01-12 22:40:26 +11:00

15 lines
772 B
Plaintext

# Borrowed with modifications from
# https://github.com/defunkt/resque/blob/master/examples/monit/resque.monit
# Replace these with your own:
# [QUEUE]
# [PATH/TO/RESQUE]
# [UID]
# [GID]
# [APP_INCLUDE]
check process resque_worker_[QUEUE]
with pidfile /var/run/resque/worker_[QUEUE].pid
start program = "/bin/sh -c 'APP_INCLUDE=[APP_INCLUDE] QUEUE=[QUEUE] VERBOSE=1 PIDFILE=/var/run/resque/worker_[QUEUE].pid nohup php -f [PATH/TO/RESQUE]/bin/resque > /var/log/resque/worker_[QUEUE].log &'" as uid [UID] and gid [GID]
stop program = "/bin/sh -c 'kill -s QUIT `cat /var/run/resque/worker_[QUEUE].pid` && rm -f /var/run/resque/worker_[QUEUE].pid; exit 0;'"
if totalmem is greater than 300 MB for 10 cycles then restart # eating up memory?
group resque_workers