I have an Upstart script for my server that looks like this:
description \"myapp node.js server\"
start on runlevel [2345]
stop on shutdown
env NODE_ENV=pr
Just for the record. The Upstart Cookbook recommends the usage of start-stop-daemon instead of su or sudo when your Upstart version does not implement setuid.
But, unless you are still using 10.04 LTS (Lucid Lynx) which only has Upstart version 0.6.5, you should be using the setuid/setgid directives.