在PythonTwisted中,有twistd
命令可以帮助您完成与运行应用程序相关的许多事情(例如daemonize).
如何对node.js服务器进行后台监控,使其在当前会话关闭后仍能运行?
在PythonTwisted中,有twistd
命令可以帮助您完成与运行应用程序相关的许多事情(例如daemonize).
如何对node.js服务器进行后台监控,使其在当前会话关闭后仍能运行?
Forever是你问题的答案.
$ curl https://npmjs.org/install.sh | sh
$ npm install forever
# Or to install as a terminal command everywhere:
$ npm install -g forever
Using Forever from the command line
$ forever start server.js
Using an instance of Forever from Node.js
var forever = require('forever');
var child = new forever.Forever('your-filename.js', {
max: 3,
silent: true,
args: []
});
child.on('exit', this.callback);
child.start();