Permalink
Browse files

Merge branch 'experimental' into wip-jeweller

* experimental:
  Restart god after changing RAILS_ENV because god stores the value of RAILS_ENV and uses it in notifications.
  • Loading branch information...
2 parents 3586549 + 76c67c8 commit 9a9bab55030a8063de1d2502f2c22e7b966e55af @pauldowman committed Oct 22, 2009
Showing with 7 additions and 0 deletions.
  1. +7 −0 server/files/usr/local/ec2onrails/bin/set_rails_env
@@ -23,6 +23,8 @@
require "yaml"
require "erb"
+require "#{File.dirname(__FILE__)}/../lib/utils"
+
if ARGV.length != 1
puts "usage: set_rails_env <value>"
@@ -34,3 +36,8 @@ end
File.open("/etc/ec2onrails/rails_env", 'w') do |f|
f << @rails_env
end
+
+# Tell god to quit, which will cause it to be restarted immediately by init.
+# When it restarts it keeps it's monitoring state. This causes it to reload
+# it's idea of RAILS_ENV because it's used in notifications.
+Utils.run "god quit"

0 comments on commit 9a9bab5

Please sign in to comment.