Skip to content

Commit 76c67c8

Browse files
committed
Restart god after changing RAILS_ENV because god stores the value of RAILS_ENV and uses it in notifications.
1 parent 4bfbc59 commit 76c67c8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/files/usr/local/ec2onrails/bin/set_rails_env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
require "yaml"
2525
require "erb"
26+
require "#{File.dirname(__FILE__)}/../lib/utils"
27+
2628

2729
if ARGV.length != 1
2830
puts "usage: set_rails_env <value>"
@@ -34,3 +36,8 @@ end
3436
File.open("/etc/ec2onrails/rails_env", 'w') do |f|
3537
f << @rails_env
3638
end
39+
40+
# Tell god to quit, which will cause it to be restarted immediately by init.
41+
# When it restarts it keeps it's monitoring state. This causes it to reload
42+
# it's idea of RAILS_ENV because it's used in notifications.
43+
Utils.run "god quit"

0 commit comments

Comments
 (0)