I have some ENV variables that are sourced for the deploy
user. (Similar to what Heroku recommends, but without using Heroku.)
My rails app depends on these for certain functions, for example, in application.rb:
config.action_mailer.default_url_options = { host: ENV['MY_HOST'] }
This is necessary because we have several staging hosts. Each host has MY_HOST
defined to its correct hostname in .bashrc
like so:
export MY_HOST="staging3.example.com"
This allows us to only use one rails staging
environment, but still have each host's correct hostname used for testing, sending email, etc since this can be set on a per-machine basis.
Unfortunately it looks like when I restart Unicorn using USR2
it doesn't pick up changes to those variables. Doing a hard-stop and start will correctly load any changes.
I'm using preload_app = true
which may I'm guessing has something to do with it. Any ideas?