Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
627 views
in Technique[技术] by (71.8m points)

running node.js server using upstart causes 'terminated with status 127' on 'ubuntu 10.04'

i have written an upstart script for ubuntu to launch my node.js server manually or on startup. But it always terminates with status 127 and i can't find more information about what is going wrong. If i execute it manually then it works and i also tested it on ubuntu 12.10 where it also works ... it only fails to work on ubuntu 10.04 which is the production server i'm using.

The script:

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

any idea where to find more information about the status 127? Or how i can fix this? i have looked in /var/log/daemon.log and in /var/log/syslog.log .. but there is no relevant info except for 'main process (29520) terminated with status 127'.

kind regards,

Daan

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

127 in bash means: "command not found", illegal_command, possible problem with $PATH or a typo.

Source: http://tldp.org/LDP/abs/html/exitcodes.html

This might be a question for server fault, as it is bash related, but this question / answer might help you:

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...