I am looking to daemonize my Node.js application. What's the difference between upstart and forever? Also, are there other packages I might want to considering looking at?
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- How to reimport module with ES6 import
- Why is `node.js` dying when called from inside pyt
- How to verify laravel passport api token in node /
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
- Get file created date in node
upstart is a general utility for daemonizing an application. Forever is designed for Node.js. For most purposes, forever is better for Node.js applications as it is simpler, tuned towards node.js and easy to configure. Just try a few tutorials on upstart and you will agree with me.
As pointed out in the comments, upstart will be used to start the forever script, since
upstart
has hooks for system events (like shutdown and startup of your server).The other differences are:
Among the available other solutions, you can try daemon, which is equivalent to forever.
I would disagree with @leorex with regards to upstart setup. Check out this blog post for an excellent example.
In 2017, alternatives could be :
Here is a (maybe biased) comparison of both with Forever.
The main difference in objective is that upstart is designed to start an application on system boot. Forever doesn't have that and instead is focused on keeping a node.js script running despite crashes (most likely unhandled exceptions). You will be wise to combine the two .. i.e. start
forever yourscript.js
from upstart (on system boot).That said you will need to look at your platform specific version of
upstart
equivalent. Upstart was never on windows and is now deprecated for ubuntu / debian : http://www.markshuttleworth.com/archives/1316