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

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
respawn limit 10 5

expect daemon

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

1 Answer 1

Check out my question on askubuntu.com about the same thing:

http://askubuntu.com/questions/3126/upstart-supervised-init-script-for-apache

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 askubuntu.com question.

share|improve this answer
add comment

Your Answer

 
discard

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.