[go: up one dir, main page]

File: states.dot

package info (click to toggle)
upstart 1.11-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 12,988 kB
  • ctags: 2,100
  • sloc: ansic: 67,932; sh: 12,339; python: 1,718; makefile: 1,093; xml: 162; sed: 16
file content (60 lines) | stat: -rw-r--r-- 2,081 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* Upstart state machine.
 *
 * Generate with:
 *   dot -Tpng -ostates.png states.dot
 *
 * Diamonds represent natural rest states in which we need to take an action
 * to change the goal.
 *
 * Ovals represent ordinary states which clear themselves when the process
 * being run, or the event that was emitted, finishes.
 *
 * Rectangles represent additional actions that are taken, they are not
 * states, instead you should follow through them to the next real state.
 *
 * Green arrows are followed while the goal is START.
 * Red arrows are followed while the goal is STOP.
 *
 * Note that from the running state, there are two read arrows leaving it;
 * these are chosen based on whether there is a process for the job or not.
 */

digraph {
	rankdir=LR;
	edge [fontsize=10];

	waiting [shape=diamond];
	starting [label="starting\n(emit starting)"];
	pre_start [label="pre-start"];
	spawned [label="spawned\n(wait for pid)"];
	post_start [label="post-start"];
	emit_started [shape=rectangle,label="emit started"];
	running [shape=diamond];
	pre_stop [label="pre-stop"];
	stopping [label="stopping\n(emit stopping)"];
	killed [label="killed\n(wait for SIGCHLD)"];
	post_stop [label="post-stop"];
	emit_stopped [shape=rectangle,label="emit stopped"];

	waiting -> starting [color=green];
	starting -> pre_start [color=green];
	starting -> stopping [color=red];
	pre_start -> spawned [color=green];
	pre_start -> stopping [color=red];
	spawned -> post_start [color=green];
	spawned -> stopping [color=red];
	post_start -> emit_started -> running [color=green];
	post_start -> stopping [color=red];
	running -> pre_stop [color=red,label="pid > 0"];
	running -> stopping [color=red,label="pid == 0"];
	running -> stopping [color=green,label="respawn"];
	pre_stop -> running [color=green];
	pre_stop -> stopping [color=red];
	stopping -> killed [color=green];
	stopping -> killed [color=red];
	killed -> post_stop [color=green];
	killed -> post_stop [color=red];
	post_stop -> starting [color=green];
	post_stop -> emit_stopped [color=red];
	emit_stopped -> waiting [color=red];
}