Create a gist now

Instantly share code, notes, and snippets.

@mguterl /monit
Created Jan 16, 2010

What would you like to do?
# this goes in /etc/sv/rm-dj-1/run
#!/bin/sh
set -e
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
APP_ROOT=/home/deploy/public_html/rm/current
cd $APP_ROOT
exec 2>&1
exec chpst -u deploy:deploy -e /etc/service/rm-dj-1/env rake jobs:work
# this goes in /etc/sv/rm-dj-1/log/run
#!/bin/sh
set -e
exec svlogd ./main
check process rm_dj_worker_1
with pidfile /etc/sv/rm-dj-1/supervise/pid
start program = "/usr/bin/sv up rm-dj-1" as uid root and gid root with timeout 3000 seconds
stop program = "/usr/bin/sv down rm-dj-1" as uid root and gid root with timeout 3000 seconds
group delayed_job
if totalmem > 175 Mb then restart
if changed pid then restart
if 3 restarts within 5 cycles then timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment