Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

How do I get Ubuntu upstart to not hang on interactive start & stop?

I have created many upstart scripts that work fine during init, but often hang when I enter them at the console. If I CTRL+C out, all that happens is that the job changes state. The script is never run.

I’m running Ubuntu Lucid on a Xen virtual server with a Linux 2.6.39 kernel.

Below is merely a representative example of many scripts that behave this way:

description "apache2"

start on local-filesystems \
  and (net-device-up IFACE=lo) \
  and (runlevel [2345])
stop on runlevel [016]

respawn limit 10 5

expect daemon

  . /etc/apache2/envvars
  /usr/sbin/apache2ctl start
end script
share|improve this question

Check out my question on about the same thing:

In the example you posted, it would come down to directly executing the apache binary vs. executing the apache2ctl script. Upstart expects the process it starts to not die immediately, basically; which is exactly what apache2ctl does.

There's a working Apache upstart script on my question.

share|improve this answer

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.