title: Upstart env stanza not setting environment variables (like NODE_ENV) for Node.js application
body: <p>I have an Upstart script for my server that looks like this:</p>
  
  <pre><code>description "myapp node.js server"
  
  start on runlevel [2345]
  stop on shutdown
  
  env NODE_ENV=production
  env CUSTOM=somevalue
  exec sudo -u nodejs /usr/local/bin/node /opt/myapp/app.js &gt;&gt; /var/log/nodejs/myapp.log 2&gt;&amp;1
  
  post-start script
      NODE_PID=`status myapp | egrep -oi '([0-9]+)$' | head -n1` 
      echo $NODE_PID &gt; /var/run/nodejs/myapp.pid
  end script
  </code></pre>
  
  <p>However, the app doesn't see NODE_ENV set to production. In fact, if I console.log(process.env) within the app, I don't see NODE_ENV or CUSTOM. Any ideas what's happening?</p>
  
  <p>By the way, NODE_ENV=production node app.js works just fine.</p>