【问题标题】:Upstart error terminated with status 1Upstart 错误以状态 1 终止
【发布时间】:2012-10-05 20:46:28
【问题描述】:

我有一个 ubuntu 10.04 服务器并尝试创建一个 upstart 脚本:

description "node-workerListener"
author      "me"

start on startup
stop on shutdown

script
        # We found $HOME is needed. Without it, we ran into problems
        export HOME="/var/www"

        exec sudo -u www-data /usr/local/bin/node /var/www/vhost/node/test/workerListener.js 2>&1 >> /var/log/node/helloworld.log
end script

这应该启动一个节点脚本,如果我在命令行上手动启动它,它就可以工作。但是当我尝试“启动 node-workerListener”时,我收到消息“node-workerListener 启动/运行,进程 1323”,但它没有。

在 /var/log/syslog 中:“...init: node-workerListener 主进程 (1317) 以状态 1 终止”

我能做什么?

【问题讨论】:

  • 运行“sudo -u www-data /usr/local/bin/node /var/www/vhost/node/test/workerListener.js 2>&1 >> /var/ 时会出现问题log/node/helloworld.log 结束脚本”在命令行?
  • 我也有同样的问题。你解决了吗?
  • 可能和sudo的使用有关...试试“sudo start node-workerListener”
  • 在互联网上的某处找到这条线 start on started mountall # used to be: start on startup // # until we found some mounts weren't ready yet while booting 评论。

标签: node.js ubuntu-10.04 upstart


【解决方案1】:

您也可以使用 forever https://github.com/nodejitsu/forever 来运行节点进程。

这是一篇详细的文章:http://blog.nodejitsu.com/keep-a-nodejs-server-up-with-forever

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-22
    • 1970-01-01
    • 1970-01-01
    • 2021-01-17
    • 1970-01-01
    • 1970-01-01
    • 2016-12-27
    相关资源
    最近更新 更多