d636c0e50faa6ec1f9d0b13f54d0ce70b974c695
[oweals/dinit.git] / doc / manpages / dinitctl.8.m4
1 changequote(`@@@',`$$$')dnl
2 @@@.TH DINITCTL "8" "$$$MONTH YEAR@@@" "Dinit $$$VERSION@@@" "Dinit \- service management system"
3 .SH NAME
4 dinitctl \- control services supervised by Dinit
5 .\"
6 .SH SYNOPSIS
7 .\"
8 .B dinitctl
9 [\fIoptions\fR] \fBstart\fR [\fB\-\-no\-wait\fR] [\fB\-\-pin\fR] \fIservice-name\fR
10 .br
11 .B dinitctl
12 [\fIoptions\fR] \fBstop\fR [\fB\-\-no\-wait\fR] [\fB\-\-pin\fR] \fIservice-name\fR
13 .br
14 .B dinitctl
15 [\fIoptions\fR] \fBrestart\fR [\fB\-\-no\-wait\fR] \fIservice-name\fR
16 .br
17 .B dinitctl
18 [\fIoptions\fR] \fBwake\fR [\fB\-\-no\-wait\fR] \fIservice-name\fR
19 .br
20 .B dinitctl
21 [\fIoptions\fR] \fBrelease\fR \fIservice-name\fR
22 .br
23 .B dinitctl
24 [\fIoptions\fR] \fBunpin\fR \fIservice-name\fR
25 .br
26 .B dinitctl
27 [\fIoptions\fR] \fBunload\fR \fIservice-name\fR
28 .br
29 .B dinitctl
30 [\fIoptions\fR] \fBlist\fR
31 .br
32 .B dinitctl
33 [\fIoptions\fR] \fBshutdown\fR
34 .br
35 .B dinitctl
36 [\fIoptions\fR] \fBadd-dep\fR \fIdependency-type\fR \fIfrom-service\fR \fIto-service\fR
37 .br
38 .B dinitctl
39 [\fIoptions\fR] \fBrm-dep\fR \fIdependency-type\fR \fIfrom-service\fR \fIto-service\fR
40 .br
41 .B dinitctl
42 [\fIoptions\fR] \fBenable\fR [\fB\-\-from\fR \fIfrom-service\fR] \fIto-service\fR
43 .br
44 .B dinitctl
45 [\fIoptions\fR] \fBdisable\fR [\fB\-\-from\fR \fIfrom-service\fR] \fIto-service\fR
46 .\"
47 .SH DESCRIPTION
48 .\"
49 \fBdinitctl\fR is a utility to control services being managed by the
50 \fBdinit\fR daemon. It allows starting and stopping services, and listing
51 service status. 
52 .\"
53 .SH GENERAL OPTIONS
54 .TP
55 \fB\-\-help\fR
56 display this help and exit
57 .TP
58 \fB\-u\fR, \fB\-\-user\fR
59 Control the user init process. The default is to control the system process. This option selects
60 the path to the control socket used to communicate with the \fBdinit\fR daemon process.
61 .TP
62 \fB\-\-socket\-path\fR \fIsocket-path\fR, \fB\-p\fR \fIsocket-path\fR
63 Specify the path to the socket used for communicating with the service manager daemon.
64 .TP
65 \fB\-\-quiet\fR
66 Suppress status output, except for errors. 
67 .\"
68 .SH COMMAND OPTIONS
69 .TP
70 \fB\-\-no\-wait\fR
71 Do not wait for issued command to complete; exit immediately.
72 .TP
73 \fB\-\-pin\fR
74 Pin the service in the requested state. The service will not leave the state until it is unpinned, although
75 start/stop commands will be "remembered" while the service is pinned.
76 .TP
77 \fB\-\-force\fR
78 Stop the service even if it will require stopping other services which depend on the specified service.
79 .TP
80 \fIservice-name\fR
81 Specifies the name of the service to which the command applies.
82 .TP
83 \fBstart\fR
84 Start the specified service. The service is marked as explicitly activated and will not be stopped
85 automatically if its dependents stop. If the service is currently stopping it will generally continue
86 to stop before it is then restarted.
87 .TP
88 \fBstop\fR
89 Stop the specified service, and remove explicit activation. If the service has (non-soft) dependents, an
90 error will be displayed unless the \fB\-\-force\fR option is used.
91
92 A service with any dependents via soft dependencies will have these dependency links broken when it stops.
93
94 The \fBrestart\fR option applied to the stopped service will not by itself cause the service to restart
95 when it is stopped via this command. However, a dependent which is configured to restart may
96 cause the service itself to restart as a result.
97
98 Any pending \fBstart\fR orders are cancelled,
99 though a service which is starting will continue its startup before then stopping (unless the service is
100 configured to have an interruptible startup or is otherwise at a stage of startup which can be safely
101 interrupted).
102 .TP
103 \fBrestart\fR
104 Restart the specified service. The service will be stopped and then restarted, without affecting explicit
105 activation status or dependency links from dependents.
106 .TP
107 \fBwake\fR
108 Start the specified service after reattaching dependency links from all active dependents of the specified
109 service. The service will not be marked explicitly activated, and so will stop if the dependents stop.
110 .TP
111 \fBrelease\fR
112 Clear the explicit activation mark from a service (the service will then stop if it has no active dependents).
113 .TP
114 \fBunpin\fR
115 Remove start- and stop- pins from a service. If a started service is not explicitly activated and
116 has no active dependents, it will stop. If a started service has a dependency service which is stopping,
117 it will stop. If a stopped service has a dependent service which is starting, it will start. Otherwise,
118 any pending start/stop commands will be carried out.
119 .TP
120 \fBunload\fR
121 Completely unload a service. This can only be done if the service is stopped and has no loaded dependents
122 (i.e. dependents must be unloaded before their dependencies).
123 .TP
124 \fBlist\fR
125 List loaded services and their state. Before each service, one of the following state indicators is
126 displayed:
127
128 .RS
129 .nf
130 \f[C]\m[blue][{+}\ \ \ \ \ ]\m[]\fR \[em] service has started.
131 \f[C]\m[blue][{\ }<<\ \ \ ]\m[]\fR \[em] service is starting.
132 \f[C]\m[blue][\ \ \ <<{\ }]\m[]\fR \[em] service is starting, will stop once started.
133 \f[C]\m[blue][{\ }>>\ \ \ ]\m[]\fR \[em] service is stopping, will start once stopped.
134 \f[C]\m[blue][\ \ \ >>{\ }]\m[]\fR \[em] service is stopping.
135 \f[C]\m[blue][\ \ \ \ \ {-}]\m[]\fR \[em] service has stopped.
136 .fi
137
138 The << and >> symbols represent a transition state (starting and stopping respectively); curly braces
139 indicate the desired state (left: started, right: stopped). An 's' in place of '+' means that service
140 startup was skipped (possible only if the service is configured as skippable). An 'X' in place of '-'
141 means that the service failed to start, or that the service process unexpectedly terminated with an
142 error status or signal while running.
143
144 Additional information, if available, will be printed after the service name: whether the service owns,
145 or is waiting to acquire, the console; the process ID; the exit status or signal that caused termination.
146 .RE
147 .TP
148 \fBshutdown\fR
149 Stop all services (without restart) and terminate Dinit. If issued to the system instance of Dinit,
150 this will also shut down the system.
151 .TP
152 \fBadd-dep\fR
153 Add a dependency between two services. The \fIdependency-type\fR must be one of \fBregular\fR,
154 \fBmilestone\fR or \fBwaits-for\fR. Note that adding a regular dependency requires that the service
155 states are consistent with the dependency (i.e. if the "from" service is started, the "to" service
156 must also be started). Circular dependency chains may not be created.
157 .TP
158 \fBrm-dep\fR
159 Remove a dependency between two services. The \fIdependency-type\fR must be one of \fBregular\fR,
160 \fBmilestone\fR or \fBwaits-for\fR. If the "to" service is not otherwise active it may be stopped
161 as a result of removing the dependency.  
162 .TP
163 \fBenable\fR
164 Permanently enable a \fBwaits-for\fR dependency between two services. This is much like \fBadd-dep\fR
165 but it also starts the dependency if the dependent is started (without explicit activation, so the
166 dependency will stop if the dependent stops), and it creates a symbolic link in the directory
167 specified via the \fBwaits-for.d\fR directive in the service description (there must be only one such
168 directive). The dependency should therefore be persistent.
169
170 If the \fB--from\fR option is not used to specify the dependent, the dependency is created from the
171 \fBboot\fR service by default.
172 .TP
173 \fBdisable\fR
174 Permanently disable a \fBwaits-for\fR dependency between two services. This is the complement of the
175 \fBenable\fR command; see the description above for more information.
176 .\"
177 .SH SERVICE OPERATION
178 .\"
179 Normally, services are only started if they have been explicitly activated (\fBstart\fR command) or if
180 a started service depends on them. Therefore, starting a service also starts all services that the first
181 depends on; stopping the same service then also stops the dependency services, unless they are also
182 required by another explicitly activated service.
183 .LP
184 A service can be pinned in either the started or stopped state. This is mainly intended to be used to
185 prevent automated stop or start of a service, including via a dependency or dependent service, during
186 a manual administrative procedure.
187 .LP
188 Stopping a service does not in general prevent it from restarting. A service configured to restart
189 automatically, or with a dependent service configured to do so, will restart immediately after stopping
190 unless pinned.
191 .\"
192 .SH SEE ALSO
193 \fBdinit\fR(8).
194 .\"
195 .SH AUTHOR
196 Dinit, and this manual, were written by Davin McCall.
197 $$$dnl