12 回复
在 ubuntu 上,用 upstart 很方便。
我的 upstart 的例子
fetch.conf is a config file for upstart
sudo cp fetch.conf /etc/init/fetch.conf
sudo start fetch sudo stop fetch
fetch.conf 内容:
#!upstart
description "Fetch server"
start on started mountall
stop on shutdown
# Automatically Respawn:
respawn
respawn limit 99 5
exec node /home/user/server.js -app=fetch >> /var/log/fetch.log 2>&1
http://caolanmcmahon.com/posts/deploying_node_js_with_upstart/