Scripts to start and manage processes with upstart
sudo mkdir /srv
git clone https://github.com/(you)/(your_project).git
git clone https://github.com/brianc/upstart-scripts.git
sudo ln -s generic-node.conf /etc/init/(your_project).conf
sudo initctl start (your_project)
The script will start a node app by running
Right now you need node installed somewhere root can access it.
To verify, make sure this return some valid output:
sudo which node
- It sets NODE_EVN=production
- It sets CWD to
- It logs your processes stdout and stderr to
That's really it. Mostly here now because I keep having to reference it on other servers I set up.
you can stop your project with
sudo initctl stop (your_project)
you can restart your project with
sudo initctl restart (your_project)
This will run your node application as root.
You are responsible for dropping to a different user within the app.
process.setgid within node.
Or modify the script to use
setgid within upstart itself.