Skip to content

Instantly share code, notes, and snippets.

@mguterl
Created January 16, 2010 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mguterl/279082 to your computer and use it in GitHub Desktop.
Save mguterl/279082 to your computer and use it in GitHub Desktop.
# 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