Please check the status of this specification in Launchpad before editing it. If it is Approved, contact the Assignee or another knowledgeable person before making changes.


This specification proposes the introduction of a new first class object into the Upstart core, that of a State. Simply defined, a State is said to be true when a certain set of conditions are true and a counter-set are false.


The pure event-driven model works extremely well for tasks, however it has notable limitations in the definition of services. Services tend to be defined not by the events that cause them to start or stop, but the system state in which they should be running.

It is true that the definition of the system state can be made entirely with reference to events, and more complex operators than just "or"; this was tackled by the ComplexEventConfig specification. However we found that with the introduction of the temporal "until" operator, and the need for state definitions to be flexible to system configuration (which set of path needs to be mounted for the filesystem to be considered ready?), the definition requirements for a service author were needlessly high.

Some of this was alleviated by the JobsAsStates specification, however this brought exactly the same issues into play when trying to combine states and did not offer the necessary flexibility to achieve some of the use cases outlined below.

By defining states themselves as first-class objects, with a prescribed behaviour that can differ from the default behaviour of jobs, we can implement the desired use cases without any particularly large burden on implementation, configuration or memory usage.

Use cases


This scope of this specification is limited to the introduction of States as a first-class object, and permitting the definition of these states as entities in their own right or states attached to job definitions.

It makes no changes to the behaviour of Events or Jobs, those will be tackled, if necessary, by further specifications.




Data preservation and migration

Unresolved issues

States (last edited 2007-06-14 14:26:02 by scott)