Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

an upstart question (I think I have read all relevant man pages but could not find the answer there): What is the sense of using a "stop on ..." stanza in the definition of a job which is a task?

The manuals tell us that such a job, after being started, just waits until its script (or exec stanza) is executed completely, and then stops automatically. Given that, what is the point in using "stop on ..." stanzas in such job definitions?

For example, this is the job definition for Upstart's (very important) rc job in Natty 11.04 (leaving out comments and empty lines):

start on runlevel [0123456]
stop on runlevel [!$RUNLEVEL]
console output
exec /etc/init.d/rc $RUNLEVEL

IMHO, the job, after being started by a runlevel event, will be stopped automatically as soon as /etc/init.d/rc $RUNLEVEL has finished.

Thank you very much for any explanation!

share|improve this question
up vote 1 down vote accepted

That would abort the task; if you tell the system to reboot because of a failure of some kind while bringing the system up, you generally don't want it to finish trying to boot first, or (worse) try to bring the system up and shut it down at the same time.

share|improve this answer
I've actually seen the latter happen on distributions with poorly-thought-out runlevel script interactions. – geekosaur Mar 16 '11 at 22:01

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.