# An example Monit configuration file for running the apn_sender background daemon # # 1. Replace #{app_name} with the path to your configuration # 2. Add any arguments between apn_sender the and start/stop command # 3. Install as a monitrc file check process redis with pidfile /tmp/redis.pid group apn_sender start program = "/usr/bin/redis-server /etc/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/apps/#{app_name}/shared/pids/apn_sender.pid group apn_sender start program = "/usr/bin/env RAILS_ENV=production /var/www/apps/{app_name}/current/script/apn_sender --environment=production start" stop program = "/usr/bin/env RAILS_ENV=production /var/www/apps/{app_name}/current/script/apn_sender --environment=production stop" depends_on redis