Hi folks, One of the questions people often ask about using upstart is, "How do I write a job to do something once the system is booted?" And the counter-question in response is, "How do you define 'booted' in an event-driven system, where further events can happen at any point?"
I was reflecting on this question today in connection with the following bug: https://bugs.launchpad.net/ubuntu/+source/plymouth/+bug/967229 And I realized that the recent work on user sessions might offer a possible answer. In the course of defining user session shutdown behavior, we *did* define a concept of when upstart is "done": when there are no longer any jobs that are "blocked" (i.e., they have a start/stop condition with an AND, where one half of the condition has been met but the other has not), and all jobs have the same goal and state (stop/waiting or start/running). We said that when the user session init reaches such a state, the system has "quiesced", and init can take further action to forcibly shut down the remaining jobs and exit. What if we were to generalize this concept, and make it a core event within upstart? That is, whenever upstart reaches this state, emit a 'quiesced' event? This would enable jobs with semantics like the following: start on runlevel [2345] stop on quiesced pre-stop exec plymouth quit Great care would need to be taken in constructing jobs to ensure that this event remains useful; for instance, anything that did 'start on runlevel [2345] and quiesced' would fire once, catch the next 'quiesced' event, and *block any further quiesced events from happening*. But in theory, this seems to me like it would be a pretty powerful extension to upstart semantics. Thoughts? -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer http://www.debian.org/ [email protected] [email protected]
signature.asc
Description: Digital signature
-- upstart-devel mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/upstart-devel
