running node.js server using upstart causes 'terminated with status 127' on 'ubuntu 10.04'
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
Daan Poron
Updated on June 14, 2022Comments
-
Daan Poron almost 2 years
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
-
Daan Poron about 11 yearsok, i extracted my startup command to a separate bash script which i execute from the upstart script and then it seems to work ...