Skip to content

Commit 1a859e2

Browse files
author
chris.boulton
committed
Add sample monit and logrotate scripts
1 parent 25fac9a commit 1a859e2

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

extras/resque.logrotate

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/var/log/resque/*.log {
2+
daily
3+
missingok
4+
rotate 7
5+
compress
6+
compressoptions -4
7+
notifempty
8+
create 640 root adm
9+
copytruncate
10+
}

extras/resque.monit

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Borrowed with modifications from
2+
# https://github.com/defunkt/resque/blob/master/examples/monit/resque.monit
3+
# Replace these with your own:
4+
# [QUEUE]
5+
# [PATH/TO/RESQUE]
6+
# [UID]
7+
# [GID]
8+
# [APP_INCLUDE]
9+
10+
check process resque_worker_[QUEUE]
11+
with pidfile /var/run/resque/worker_[QUEUE].pid
12+
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]
13+
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;'"
14+
if totalmem is greater than 300 MB for 10 cycles then restart # eating up memory?
15+
group resque_workers

0 commit comments

Comments
 (0)