Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using Upstart on an ubuntu server to manage some server processes I have running. My problem is that if I "stop " a couple of times, the process dies but then automatically starts running again. I need it to actually stop permanently when issued the stop command.

In this case, I'm using Upstart to manage some node.js servers. This is a sample of my init file for one of them.

description "node.js server"

start on started
stop on shutdown

script
    # We found $HOME is needed. Without it, we ran into problems
    export HOME="/root"

    exec sudo -u www-data /usr/local/bin/node /usr/local/apps/servername/app.js
end script

What do I need to change in my config?

share|improve this question
add comment

1 Answer

started is a generic event emitted by any job that has been started on the system. So if there are any udev events or other things causing any upstart jobs to start, then your job will be started again.

Perhaps you want

start on runlevel [2345]
stop on runlevel [016]

Instead.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.