Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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]
export RUNLEVEL
export PREVLEVEL
console output
env INIT_VERBOSE
task
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
add comment

1 Answer 1

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
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.