Implement service unloading.
[oweals/dinit.git] / doc / manpages / dinitctl.8
1 .TH DINITCTL "8" "June 2017" "Dinit 0.08" "Dinit \- service management system"
2 .SH NAME
3 dinitctl \- control services supervised by Dinit
4 .\"
5 .SH SYNOPSIS
6 .\"
7 .B dinitctl
8 [\-s] [\-\-quiet] start [\-\-no\-wait] [\-\-pin] [\fIservice-name\fR]
9 .br
10 .B dinitctl
11 [\-s] [\-\-quiet] stop [\-\-no\-wait] [\-\-pin] [\fIservice-name\fR]
12 .br
13 .B dinitctl
14 [\-s] [\-\-quiet] wake [\-\-no\-wait] [\fIservice-name\fR]
15 .br
16 .B dinitctl
17 [\-s] [\-\-quiet] release [\fIservice-name\fR]
18 .br
19 .B dinitctl
20 [\-s] [\-\-quiet] unpin [\fIservice-name\fR]
21 .br
22 .B dinitctl
23 unload [\fIservice-name\fR]
24 .br
25 .B dinitctl
26 [\-s] list
27 .\"
28 .SH DESCRIPTION
29 .\"
30 \fBdinitctl\fR is a utility to control services being managed by the
31 \fBdinit\fR daemon. It allows starting and stopping services, and listing
32 service status. 
33 .\"
34 .SH OPTIONS
35 .TP
36 \fB\-\-help\fR
37 display this help and exit
38 .TP
39 \fB\-\-no\-wait\fR
40 Do not wait for issued command to complete; exit immediately.
41 .TP
42 \fB\-\-pin\fR
43 Pin the service in the requested state. The service will not leave the state until it is unpinned, although
44 start/stop commands will be "remembered" while the service is pinned.
45 .TP
46 \fB\-s\fR, \fB\-\-system\fR
47 Control the system init process. The default is to control the user process. This option selects
48 the path to the control socket used to communicate with the \fBdinit\fR daemon process.
49 .TP
50 \fIservice-name\fR
51 Specifies the name of the service to which the command applies.
52 .TP
53 \fBstart\fR
54 Start the specified service. The service is marked as explicitly activated and will not be stopped
55 automatically if its dependents stop. If the service is currently stopping it will generally continue
56 to stop before it is then restarted.
57 .TP
58 \fBstop\fR
59 Stop the specified service, and remove explicit activation. The service will stop, but may restart
60 immediately if it or any dependents are configured to restart.  Any pending \fBstart\fR orders are cancelled,
61 though a service which is starting might continue its startup before then stopping.
62 .TP
63 \fBwake\fR
64 Start the specified service, but do not mark it as explicitly activated if it is not already so
65 marked.
66 .TP
67 \fBrelease\fR
68 Clear the explicit activation mark from a service (service will then stop if it has no active dependents).
69 .TP
70 \fBunpin\fR
71 Remove start- and stop- pins from a service. If a started service is not explicitly activated and
72 has no active dependents, it will stop. If a started service has a dependency service which is stopping,
73 it will stop. If a stopped service has a dependent service which is starting, it will start. Otherwise,
74 any pending start/stop commands will be carried out.
75 .TP
76 \fBunload\fR
77 Completely unload a service. This can only be done if the service is stopped and has no loaded dependents
78 (i.e. dependents must be unloaded before their dependencies).
79 .TP
80 \fBlist\fR
81 List loaded services and their state. Before each service, one of the following state indicators is
82 displayed:
83
84 .RS
85 .nf
86 \f[C]\m[blue][{+}\ \ \ \ \ ]\m[]\fR \[em] service has started.
87 \f[C]\m[blue][{\ }<<\ \ \ ]\m[]\fR \[em] service is starting.
88 \f[C]\m[blue][\ \ \ <<{\ }]\m[]\fR \[em] service is starting, will stop once started.
89 \f[C]\m[blue][{\ }>>\ \ \ ]\m[]\fR \[em] service is stopping, will start once stopped.
90 \f[C]\m[blue][\ \ \ >>{\ }]\m[]\fR \[em] service is stopping.
91 \f[C]\m[blue][\ \ \ \ \ {-}]\m[]\fR \[em] service has stopped.
92 .fi
93
94 The << and >> symbols represent a transition state (starting and stopping respectively); curly braces
95 indicate the desired state (left: started, right: stopped).
96 .RE
97 .TP
98 \fBshutdown\fR
99 Stop all services (without restart) and terminate Dinit. If issued to the system instance of Dinit,
100 this will also shut down the system.
101 .\"
102 .SH SERVICE OPERATION
103 .\"
104 Normally, services are only started if they have been explicitly activated (\fBstart\fR command) or if
105 a started service depends on them. Therefore, starting a service also starts all services that the first
106 depends on; stopping the same service then also stops the dependency services, unless they are also
107 required by another explicitly activated service.
108 .LP
109 A service can be pinned in either the started or stopped state. This is mainly intended to be used to
110 prevent automated stop or start of a service, including via a dependency or dependent service, during
111 a manual administrative procedure.
112 .LP
113 Stopping a service does not in general prevent it from restarting. A service configured to restart
114 automatically, or with a dependent service configured to do so, will restart immediately after stopping
115 unless pinned.
116 .\"
117 .SH SEE ALSO
118 \fBdinit\fR(8).
119 .\"
120 .SH AUTHOR
121 Dinit, and this manual, were written by Davin McCall.