Upstart error terminated with status 1


I have an ubuntu 10.04 server and tried to create an upstart script:

description "node-workerListener"
author      "me"

start on startup
stop on shutdown

        # 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

This should start a node script, which works, if I start it manually on the command line. But when i try to "start node-workerListener" I get the message "node-workerListener start/running, process 1323", but it doesn't.

In /var/log/syslog: "...init: node-workerListener main process (1317) terminated with status 1"

What can I do?

Problem courtesy of: bernhardh


You can also use forever to run the node process.

Here is a detailled article :

Solution courtesy of: xavier.seignard


There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.