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 exporting an environment variable to all job processes so that it is possible for scripts and binaries to determine which job they are being run within.
Jobs will frequently use libraries of functions or helper tools that may wish to adjust their behaviour depending on the job being run. In particular, initctl may wish to act on the job it's being called from by default.
- Common function or binary that changes behaviour for a certain job.
Allow calling of start or stop directly from a job without having to specify the job name.
The scope of this specification is limited to the addition and use of this environment variable.
The name of the job is placed in the UPSTART_JOB environment variable for any process.
initctl commands that accept a job will default to UPSTART_JOB if none is given.
pre-start script [ $DISABLED ] && stop end script post-stop script [ $RESPAWN ] && start end script
The environment variable will be seeded by modifying process_setup_environment in init/process.c.
start_action in util/initctl.c will be modified to check this variable when no arguments are given, and only error if the variable is also missing.
Data preservation and migration
These changes are backwards compatible with the previous behaviour.