Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sample monit and logrotate scripts
- Loading branch information
chris.boulton
committed
Mar 27, 2011
1 parent
25fac9a
commit 1a859e2
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/var/log/resque/*.log { | ||
daily | ||
missingok | ||
rotate 7 | ||
compress | ||
compressoptions -4 | ||
notifempty | ||
create 640 root adm | ||
copytruncate | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 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]/resque.php > /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 |