gpt4 book ai didi

node.js - 使用 Upstart 运行 node.js 服务器导致 'terminated with status 127' 上的 'ubuntu 10.04'

转载 作者:搜寻专家 更新时间:2023-10-31 22:22:53 25 4
gpt4 key购买 nike

我已经为 ubuntu 编写了一个 upstart 脚本来手动或在启动时启动我的 node.js 服务器。但它总是以状态 127 终止,我找不到有关问题所在的更多信息。如果我手动执行它然后它工作并且我还在 ubuntu 12.10 上测试它也可以工作......它只无法在我正在使用的生产服务器 ubuntu 10.04 上工作。

脚本:

description ""
author ""

start on started mountall
stop on shutdown
respawn
respawn limit 20 5

# Max open files are @ 1024 by default. Bit few.
limit nofile 32768 32768

env HOME=/home/projects/<project_name>/data/current

script
export HOME=$HOME
chdir $HOME
exec sudo -u <user_to_launch_the_script> /usr/bin/node /home/projects/<project_name>/data/current/server.js 2>&1 >> /var/log/node.log
end script

知道在哪里可以找到有关状态 127 的更多信息吗?或者我该如何解决这个问题?我查看了/var/log/daemon.log 和/var/log/syslog.log .. 但除了“主进程 (29520) 以状态 127 终止”之外没有相关信息。

亲切的问候,

大安

最佳答案

127 在 bash 中表示:“未找到命令”,非法命令,$PATH 可能有问题或输入错误。

来源:http://tldp.org/LDP/abs/html/exitcodes.html

这可能是服务器故障的问题,因为它与 bash 相关,但这个问题/答案可能对您有所帮助:

https://serverfault.com/questions/277706/cron-fails-with-exit-status-127

关于node.js - 使用 Upstart 运行 node.js 服务器导致 'terminated with status 127' 上的 'ubuntu 10.04',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14692843/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com