Reputation: 5468
I don't know what I should call it on Ubuntu Server, but most time I work on Windows it is called a service for running an application on the background.
I build my web server based on Node.js, so to deploy it on Ubuntu sever I need a 'service' for running Node.js, I want the 'service':
Normally, I run a Node.js application by opening a terminal an run the js file. But from my understanding this is more for testing purpose because there is no guarantee from the terminal to start Node.js after a fail.
Upvotes: 9
Views: 13193
Reputation: 459
Many people use forever https://github.com/nodejitsu/forever , which has become pretty much industry standard.
If you are on Ubuntu, you can also use init scripts ( google 'ubuntu upstart' ), that will do much the same thing, and are guaranteed to if the server ever gets restarted.
Here is my upstart script for example https://gist.github.com/qbert65536/5271721 .
It gets run when the server starts, you also control them with
start myapp, stop myapp, restart myapp , where myapp.conf is the name of the upstart script.
Upvotes: 21