stopped – event signalling that a job has stopped
event is generated by the Upstart
daemon when an instance of a job has stopped. The
environment variable contains the job name, and the
environment variable contains the instance name which will be empty for
If the job was stopped normally, the
environment variable will be
otherwise if the job was stopped because it has failed it will be
When the job has failed, the process that failed will be given in the
environment variable. This may be
pre-start, post-start, main, pre-stop or post-stop;
it may also be the special value
to indicate that the job was stopped because it hit the respawn limit.
Finally in the case of a failed job, one of either
may be given to indicate the cause of the stop. Either
will contain the exit status code of the process, or
will contain the name of the signal that the process received. The
job configuration stanza can be used to prevent particular exit status
values or signals resulting in a failed job, see
for more information.
is given for a failed process, it is because the process failed to spawn
(for example, file not found). See the system logs for the error.
emits this event as an informational signal, services and tasks started
or stopped by this event will do so in parallel with other activity. It
is typically combined with the
event by services when inserting themselves as a dependency.
Job configuration files may use the
stanza to export environment variables from their own environment into
for more details.
A service that wishes to be running whenever another service would be
running, started before and stopped after it, might use:
start on starting apache
stop on stopped apache
A task that must be run after another task or service has been stopped
start on stopped postgresql