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

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

1 Answer 1

Read this section of the Upstart Cookbook very carefully: http://upstart.ubuntu.com/cookbook/#expect

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

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.