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

    # 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?


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]


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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