0

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?

Geuis
  • 637
  • 3
  • 8
  • 20

1 Answers1

2

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.

SpamapS
  • 348
  • 1
  • 8