generators/vulcanize/templates/sphinx/config/rubber/role/sphinx/monit-sphinx.conf in sml-rubber-0.9.13 vs generators/vulcanize/templates/sphinx/config/rubber/role/sphinx/monit-sphinx.conf in sml-rubber-1.5.5
- old
+ new
@@ -1,10 +1,13 @@
<%
@path = '/etc/monit/monit.d/monit-sphinx.conf'
+
+ PIDFILE = "#{RUBBER_ROOT}/log/searchd.#{RUBBER_ENV}.pid"
+ start_program = "cd #{RUBBER_ROOT} && rake ts:start"
+ stop_program = "cd #{RUBBER_ROOT} && rake ts:stop"
%>
-check process sphinx with pidfile <%= RUBBER_ROOT %>/log/searchd.<%= RUBBER_ENV %>.pid
+check process sphinx with pidfile <%= PIDFILE %>
group sphinx-<%= RUBBER_ENV %>
- start program = "/usr/bin/sudo -u rails sh -c 'cd <%= RUBBER_ROOT %> && PATH=/usr/local/bin:$PATH RAILS_ENV=<%= RUBBER_ENV %> rake ts:start'"
- stop program = "/usr/bin/sudo -u rails sh -c 'cd <%= RUBBER_ROOT %> && PATH=/usr/local/bin:$PATH RAILS_ENV=<%= RUBBER_ENV %> rake ts:stop'"
+ start program = "/usr/bin/sudo -H -u <%= rubber_env.app_user %> bash -l -c '<%= start_program %>'"
+ stop program = "/usr/bin/sudo -H -u <%= rubber_env.app_user %> bash -l -c '<%= stop_program %>'"
if failed host <%= rubber_env.host %> port 3312 with timeout 5 seconds for 5 cycles then restart
-