1stopping(7) Miscellaneous Information Manual stopping(7)
2
3
4
6 stopping - event signalling that a job is stopping
7
9 stopping JOB=JOB INSTANCE=INSTANCE RESULT=RESULT [PROCESS=PROCESS]
10 [EXIT_STATUS=STATUS] [EXIT_SIGNAL=SIGNAL] [ENV]...
11
13 The stopping event is generated by the Upstart init(8) daemon when an
14 instance of a job begins stopping. The JOB environment variable con‐
15 tains the job name, and the INSTANCE environment variable contains the
16 instance name which will be empty for single-instance jobs.
17
18 If the job is stopping normally, the RESULT environment variable will
19 be ok, otherwise if the job is stopping because it has failed it will
20 be failed.
21
22 When the job has failed, the process that failed will be given in the
23 PROCESS environment variable. This may be pre-start, post-start, main,
24 pre-stop or post-stop; it may also be the special value respawn to
25 indicate that the job is stopping because it hit the respawn limit.
26
27 Finally in the case of a failed job, one of either EXIT_STATUS or
28 EXIT_SIGNAL may be given to indicate the cause of the stop. Either
29 EXIT_STATUS will contain the exit status code of the process, or
30 EXIT_SIGNAL will contain the name of the signal that the process
31 received. The normal exit job configuration stanza can be used to pre‐
32 vent particular exit status values or signals resulting in a failed
33 job, see init(5) for more information.
34
35 If neither EXIT_STATUS or EXIT_SIGNAL is given for a failed process, it
36 is because the process failed to spawn (for example, file not found).
37 See the system logs for the error.
38
39 init(8) will wait for all services started by this event to be running,
40 all tasks started by this event to have finished and all jobs stopped
41 by this event to be stopped before allowing the job to continue stop‐
42 ping.
43
44 This allows jobs to depend on other jobs, safely stopping themselves
45 before their dependency goes away. This event is typically combined
46 with the started(7) event by services.
47
48 Job configuration files may use the export stanza to export environment
49 variables from their own environment into the stopping event. See
50 init(5) for more details.
51
53 A service that wishes to depend on another service might use:
54
55 start on started apache
56 stop on stopping apache
57
58 A task that must be run before another task or service is stopped might
59 use:
60
61 start on stopping postgresql RESULT=ok
62
64 starting(7) started(7) stopped(7) init(5)
65
66
67
68Upstart 2009-07-09 stopping(7)