contrib/apn_sender.monitrc in apn_sender-0.0.7 vs contrib/apn_sender.monitrc in apn_sender-1.0.0
- old
+ new
@@ -1,13 +1,21 @@
-# an example Monit configuration file for running the apple_push_notification background sender
+# An example Monit configuration file for running the apn_sender background daemon
#
-# To use:
-# 1. copy to /var/www/apps/{app_name}/shared/apn_sender.monitrc
-# 2. replace {app_name} as appropriate
-# 3. add this to your /etc/monit/monitrc
-#
-# include /var/www/apps/{app_name}/shared/apn_sender.monitrc
+# 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
- start program = "/usr/bin/env RAILS_ENV=production /var/www/apps/{app_name}/current/script/apn_sender start"
- stop program = "/usr/bin/env RAILS_ENV=production /var/www/apps/{app_name}/current/script/apn_sender stop"
+ 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
\ No newline at end of file