Skip to content

Instantly share code, notes, and snippets.

@thotmx
Last active August 10, 2019 15:23
Show Gist options
  • Save thotmx/8603187 to your computer and use it in GitHub Desktop.
Save thotmx/8603187 to your computer and use it in GitHub Desktop.
Monit: Restart unicorn automatically
check process unicorn-<<aplicacion>>
with pidfile /home/deployer/apps/<<aplicacion>>/current/tmp/pids/unicorn.pid
start program = "/etc/init.d/unicorn_blog start"
stop program = "/etc/init.d/unicorn_blog stop"
restart program = "/etc/init.d/unicorn_blog stop && /etc/init.d/unicorn_blog start"
group unicorn-blog
check file blog-restart with path /home/deployer/apps/<<aplicacion>>/current/tmp/restart.txt
if changed timestamp
then exec "/usr/bin/monit -g unicorn-blog restart"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment