5

If the daemon process dies, I'm unable to restart it manually: start foo results in a message that "start: Job is already running: foo", and stop foo hangs indefinitely.

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

kill timeout 90
expect daemon

pre-start script
  rm -f ${HOME}/RUNNING_PID
end script

exec start-stop-daemon \
  --pidfile ${HOME}/RUNNING_PID --chuid $USER:$GROUP \
  --exec ${HOME}/bin/run --start > run.log 2>&1

There's no process owned by $USER and no pidfile, so why does upstart think the daemon is still running, and how can I convince it otherwise?

ejain
  • 233
  • 2
  • 7

1 Answers1

6

Workaround: Rename the the foo service to foo2...

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582745

ejain
  • 233
  • 2
  • 7
  • 1
    I can confirm that this is true. Short of a restart there is no practicable way to convince upstart that it's internal state is wrong. Source: Dealt with a very complex production environment experiencing this very situation due to a bad daemon build. – caskey Feb 19 '14 at 02:28