Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to be able to use upstart to manage daemons where I don't have complete control over the forking behaviour. The "pid" stanza is removed as of version 0.3.9, so I can't point it at a pid file. What is the correct way to go about this? Do I have to write a wrapper script that issues SIGSTOP?

share|improve this question

Read this section of the Upstart Cookbook very carefully:

In a nutshell, if your daemon forks once, use "expect fork". If it truly daemonizes (double-forks), specify "expect daemon".

share|improve this answer
As mentioned, I don't have complete control over the forking behaviour. I can't know how many times the application will fork before getting to the true process. I do have a pid file, however, and it seems strange that there is no way to communicate this information to upstart. – mispy May 2 '12 at 0:15
@mispy: well, that's design of upstart: to be able to reliably monitor a daemon, it needs to know its forking behaviour and pid files do not help (as pids they contain can differ from reality). – thor May 11 '13 at 20:11
The fun part is when you are experimenting to figure out how many forks to expect, upstart can wedge completely in such a way that it blocks reboot and necessitates a power cycling of the system. Being able to check a pid file, which has worked forever, would be a reasonable feature. – dannyman May 13 '15 at 23:34

Your Answer


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.