Skip to content
Browse files

Corrected restart task for runit and async-observer worker

Load .bash_profile in worker run script so environment variables are present
  • Loading branch information...
1 parent 757acda commit 3f078958a86e0f962ea5e3acc0cac31e91f6c695 @topfunky topfunky committed Nov 10, 2008
Showing with 5 additions and 1 deletion.
  1. +2 −1 recipes/peepserver_runit.rb
  2. +3 −0 recipes/templates/runit/async_observer_worker.erb
View
3 recipes/peepserver_runit.rb
@@ -59,7 +59,8 @@ def install_runit_service(service_name)
desc "Restart async-observer worker for this application"
task :restart_async_observer do
- run "sv restart ~/service/#{application}-async_observer"
+ # Try to force-restart, then continue if it fails
+ run "sv -w 20 force-restart ~/service/#{application}-async_observer; true"
end
desc "Install runit task for memcache"
View
3 recipes/templates/runit/async_observer_worker.erb
@@ -1,4 +1,7 @@
#!/bin/sh
+# Load custom environment vars
+. ~/.bash_profile
+
exec 2>&1
exec /opt/ruby-enterprise/bin/ruby <%= current_path %>/vendor/plugins/async-observer/bin/worker

0 comments on commit 3f07895

Please sign in to comment.
Something went wrong with that request. Please try again.