質問

I'm having an issue where upstart is respawning a Node.js (v0.8.8) process that is completely healthy. I'm on Ubunut 11.10. When I run the program from the command line it is completely stable and does not crash. But, when I run it with upstart, it gets respawned pretty consistently every few seconds. I'm not sure what is going on and none of logs seem to help. In fact, there are no error messages produced any of the upstart logs for the job. Below is my upstart script:

#!upstart
description "server.js"

start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown

# Automtically respawn
respawn                 # restart when job dies
respawn limit 99 5      # give up restart after 99 respawns in 5 seconds

script
    export HOME="/home/www-data"

    exec sudo -u www-data NODE_ENV="production" /usr/local/bin/node /var/www/server/current/server.js >> /var/log/node.log 2>> /var/log/node.error.log
end script

post-start script
    echo "server-2 has started!"
end script

The strange thing is that server-1 works perfectly fine and is setup the same way.

syslog messages look like this:

Sep 24 15:40:28 domU-xx-xx-xx-xx-xx-xx kernel: [5272182.027977] init: server-2 main process (3638) terminated with status 1

Sep 24 15:40:35 domU-xx-xx-xx-xx-xx-xx kernel: [5272189.039308] init: server-2 main process (3647) terminated with status 1

Sep 24 15:40:42 domU-xx-xx-xx-xx-xx-xx kernel: [5272196.050805] init: server-2 main process (3656) terminated with status 1

Sep 24 15:40:49 domU-xx-xx-xx-xx-xx-xx kernel: [5272203.064022] init: server-2 main process (3665) terminated with status 1

Any help would be appreciated. Thanks.

役に立ちましたか?

解決

Ok, seems that it was actually monit that was restarting it. Problem has been solved. Thanks.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top