arthurnn/apn_sender

View on GitHub
contrib/apn_sender.monitrc

Summary

Maintainability
Test Coverage
# An example Monit configuration file for running the apn_sender background daemon
#
#   1. Replace #{app_name} with your application name
#   2. Add any arguments between apn_sender the and start/stop command
#   3. Install as a monitrc file (paste to bottom of /etc/monit/monitrc, or save as a .monitrc file and include in the main config)

check process redis
  with pidfile /var/run/redis.pid
  group apn_sender
  start program = "/usr/bin/redis-server /etc/redis/redis.conf"
  stop program = "/bin/echo SHUTDOWN | nc localhost 6379"
  if failed host 127.0.0.1 port 6379 then restart
  if 5 restarts within 5 cycles then timeout


check process apn_sender
  with pidfile /var/www/#{app_name}/shared/pids/apn_sender.pid
  group apn_sender
  start program = "/var/www/#{app_name}/current/script/apn_sender --environment=production --verbose start"
  stop program = "/var/www/{#app_name}/current/script/apn_sender --environment=production --verbose stop"
  if 2 restarts within 3 cycles then timeout
  depends on redis