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.


Upstart currently has a three-level state machine; goal, job state and process state. This specification proposes reducing that to a two-level state machine, combining the two lower levels into one.


The current three-level state machine is confusing, and doesn't allow as much flexibility as we would like. In particular, it's not ideal for extending the states to allow for additional scripts and actions.

Use cases


The scope of this specification is limited to modifying the current state machine, specifying where the events defined in JobEvents are emitted and when the scripts specified in JobScripts are to be run.


State Diagram

The easiest way to describe the proposed state machine is with a diagram ([ dot source]):


Within this diagram, the following applies:




The implementation is largely confined to upstart/job.h, init/job.h and init/job.c.

The Job structure will lose its process_state member, and the ProcessState enum will be removed.

job_next_state and job_change_state will be amended to use the new states, other references will be adjusted.

Data preservation and migration

These changes are backwards compatible with the previous behaviour.


JobStates (last edited 2006-12-13 20:09:59 by scott)