Skip to content

Instantly share code, notes, and snippets.

@remon
Forked from thotmx/monit_aplicacion
Created August 10, 2019 15:23
Show Gist options
  • Save remon/4093d9a6cf51f15cda8d3ade7ff063b4 to your computer and use it in GitHub Desktop.
Save remon/4093d9a6cf51f15cda8d3ade7ff063b4 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