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://blueprints.launchpad.net/upstart/+spec/named-instances
Jobs currently fall into two broad types: singletons, where only one instance of the job may be active at any one time; and instance jobs where any number may be active, and all start requests start a new instance. This specification proposes the addition of a third type, jobs where the number of instances is limited by giving each a unique name; only a new name will start a new instance.
In practice, unlimited-instance jobs are quite rare and difficult to use since any number can be running at once thus contention of resources and locking become an issue. While the Resources specification attempts to resolve the locking issues, this would cause new instances to be queued after the active one instead of just re-using the active one.
The getty job must have one instance running for each virtual and serial console; each should respawn and restart individually.
The apache job must normally only have one instance running, but if an alternate config file is specified, that can specify different ports or IP addresses so multiple instances with different configurations are permitted.
This scope of this specification is limited to the addition of an intermediate instance limitation between singleton and unlimited; no other issues are addressed.
- Instances shall be limited by a unique name assigned to each.
The name pattern shall be specified by an optional argument to the instance stanza:
- When no argument is present, the instances are unlimited.
- The instance name itself shall be created by expanding variable references in the configured name pattern:
- Only one instance of any name may be active at one time. Should the start request generate an instance name that is already active, it will be ignored if the instance goal is start or that instance will be restarted if it is stop.
Data preservation and migration
These changes are backwards compatible with the previous behaviour, since they only add new functionality.