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.
Launchpad entry: https://launchpad.net/products/upstart/+spec/emits
Summary
This specification proposes introducing a new emits configuration stanza to aid charting of the relationship between jobs.
Rationale
There is currently no method to determine what events a job is likely to emit, other than those generated by upstart. This means that it's difficult to automatically chart the relationships between jobs. This new stanza would be optional and advisory, but aid in this.
Use cases
The udev job can emit several events, when charting the relationships, any script started by these events should be linked to udev.
Scope
The scope of this specification is limited to the introduction of a new documentation stanza, it does not specify any further use or limitation of use for this stanza.
Design
The new stanza will be named emits.
Each argument will be considered to be the name of an event emitted.
emits block-device-added block-device-removed
Multiple stanzas are permitted.
emits block-device-added block-device-removed emits network-device-added network-device-removed
These are stored in an advisory list, available to other processes.
Implementation
Code
The implementation is largely confined to the configuration file parser, adding the new stanza and parsing it.
The Job structure in init/job.h will gain a new member to hold a list of these events:
NihList *emits;
Each member will be an Event structure (or possible just a Name).
A method will be added to libupstart to permit the list of emitted events to be queried.
Data preservation and migration
These changes are backwards compatible with the previous behaviour.