title: Re-source .bashrc when restarting unicorn?
body: <p>I have some ENV variables that are sourced for the <code>deploy</code> user. (Similar to what <a href="http://devcenter.heroku.com/articles/config-vars" rel="nofollow">Heroku recommends</a>, but without using Heroku.)</p>
  
  <p>My rails app depends on these for certain functions, for example, in application.rb:</p>
  
  <pre><code>config.action_mailer.default_url_options = { host: ENV['MY_HOST'] }
  </code></pre>
  
  <p>This is necessary because we have several staging hosts. Each host has <code>MY_HOST</code> defined to its correct hostname in <code>.bashrc</code> like so:</p>
  
  <pre><code>export MY_HOST="staging3.example.com"
  </code></pre>
  
  <p>This allows us to only use one rails <code>staging</code> 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.</p>
  
  <p>Unfortunately it looks like when I restart Unicorn using <code>USR2</code> it doesn't pick up changes to those variables. Doing a hard-stop and start will correctly load any changes.</p>
  
  <p>I'm using <code>preload_app = true</code> which may I'm guessing has something to do with it. Any ideas?</p>