]>
Commit | Line | Data |
---|---|---|
514094f9 | 1 | <?xml version='1.0'?> |
7874bcd6 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
681eb9cf FB |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ |
4 | <!ENTITY % entities SYSTEM "custom-entities.ent" > | |
5 | %entities; | |
6 | ]> | |
7874bcd6 LP |
7 | |
8 | <!-- | |
572eb058 | 9 | SPDX-License-Identifier: LGPL-2.1+ |
7874bcd6 LP |
10 | --> |
11 | ||
21ac6ff1 ZJS |
12 | <refentry id="systemctl" |
13 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
7874bcd6 | 14 | |
4a6022f0 ZJS |
15 | <refentryinfo> |
16 | <title>systemctl</title> | |
17 | <productname>systemd</productname> | |
4a6022f0 ZJS |
18 | </refentryinfo> |
19 | ||
20 | <refmeta> | |
21 | <refentrytitle>systemctl</refentrytitle> | |
22 | <manvolnum>1</manvolnum> | |
23 | </refmeta> | |
24 | ||
25 | <refnamediv> | |
26 | <refname>systemctl</refname> | |
27 | <refpurpose>Control the systemd system and service manager</refpurpose> | |
28 | </refnamediv> | |
29 | ||
30 | <refsynopsisdiv> | |
31 | <cmdsynopsis> | |
32 | <command>systemctl</command> | |
33 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
34 | <arg choice="plain">COMMAND</arg> | |
da5e955f | 35 | <arg choice="opt" rep="repeat">UNIT</arg> |
4a6022f0 ZJS |
36 | </cmdsynopsis> |
37 | </refsynopsisdiv> | |
38 | ||
39 | <refsect1> | |
40 | <title>Description</title> | |
41 | ||
a4390b6b LP |
42 | <para><command>systemctl</command> may be used to introspect and |
43 | control the state of the <literal>systemd</literal> system and | |
44 | service manager. Please refer to | |
4a6022f0 | 45 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
a4390b6b LP |
46 | for an introduction into the basic concepts and functionality this |
47 | tool manages.</para> | |
4a6022f0 ZJS |
48 | </refsect1> |
49 | ||
50 | <refsect1> | |
51 | <title>Options</title> | |
52 | ||
53 | <para>The following options are understood:</para> | |
54 | ||
55 | <variablelist> | |
4a6022f0 ZJS |
56 | <varlistentry> |
57 | <term><option>-t</option></term> | |
58 | <term><option>--type=</option></term> | |
59 | ||
60 | <listitem> | |
e9dd9f95 | 61 | <para>The argument should be a comma-separated list of unit |
20b3f379 | 62 | types such as <option>service</option> and |
9b9b3d36 MW |
63 | <option>socket</option>. |
64 | </para> | |
20b3f379 ZJS |
65 | |
66 | <para>If one of the arguments is a unit type, when listing | |
7b870f60 | 67 | units, limit display to certain unit types. Otherwise, units |
4a6022f0 ZJS |
68 | of all types will be shown.</para> |
69 | ||
20b3f379 | 70 | <para>As a special case, if one of the arguments is |
4a6022f0 ZJS |
71 | <option>help</option>, a list of allowed values will be |
72 | printed and the program will exit.</para> | |
73 | </listitem> | |
74 | </varlistentry> | |
75 | ||
9b9b3d36 MW |
76 | <varlistentry> |
77 | <term><option>--state=</option></term> | |
78 | ||
79 | <listitem> | |
e16972e6 ZJS |
80 | <para>The argument should be a comma-separated list of unit |
81 | LOAD, SUB, or ACTIVE states. When listing units, show only | |
a8eaaee7 | 82 | those in the specified states. Use <option>--state=failed</option> |
e16972e6 ZJS |
83 | to show only failed units.</para> |
84 | ||
85 | <para>As a special case, if one of the arguments is | |
86 | <option>help</option>, a list of allowed values will be | |
87 | printed and the program will exit.</para> | |
9b9b3d36 MW |
88 | </listitem> |
89 | </varlistentry> | |
90 | ||
4a6022f0 ZJS |
91 | <varlistentry> |
92 | <term><option>-p</option></term> | |
93 | <term><option>--property=</option></term> | |
94 | ||
95 | <listitem> | |
54c31a79 | 96 | <para>When showing unit/job/manager properties with the |
ea539eb6 ZJS |
97 | <command>show</command> command, limit display to properties |
98 | specified in the argument. The argument should be a | |
d2bbca68 | 99 | comma-separated list of property names, such as |
ea539eb6 ZJS |
100 | <literal>MainPID</literal>. Unless specified, all known |
101 | properties are shown. If specified more than once, all | |
102 | properties with the specified names are shown. Shell | |
103 | completion is implemented for property names.</para> | |
104 | ||
105 | <para>For the manager itself, | |
106 | <command>systemctl show</command> will show all available | |
107 | properties. Those properties are documented in | |
108 | <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
109 | </para> | |
110 | ||
111 | <para>Properties for units vary by unit type, so showing any | |
112 | unit (even a non-existent one) is a way to list properties | |
b938cb90 | 113 | pertaining to this type. Similarly, showing any job will list |
ea539eb6 ZJS |
114 | properties pertaining to all jobs. Properties for units are |
115 | documented in | |
116 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
117 | and the pages for individual unit types | |
118 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
119 | <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
120 | etc.</para> | |
4a6022f0 ZJS |
121 | </listitem> |
122 | </varlistentry> | |
123 | ||
124 | <varlistentry> | |
125 | <term><option>-a</option></term> | |
126 | <term><option>--all</option></term> | |
127 | ||
128 | <listitem> | |
21b587cf ZJS |
129 | <para>When listing units with <command>list-units</command>, also show inactive units and |
130 | units which are following other units. When showing unit/job/manager properties, show all | |
131 | properties regardless whether they are set or not.</para> | |
132 | ||
133 | <para>To list all units installed in the file system, use the | |
a5e4972c | 134 | <command>list-unit-files</command> command instead.</para> |
e9fbae3f ZJS |
135 | |
136 | <para>When listing units with <command>list-dependencies</command>, recursively show | |
137 | dependencies of all dependent units (by default only dependencies of target units are | |
138 | shown).</para> | |
4a6022f0 ZJS |
139 | </listitem> |
140 | </varlistentry> | |
141 | ||
1238ee09 LP |
142 | <varlistentry> |
143 | <term><option>-r</option></term> | |
144 | <term><option>--recursive</option></term> | |
145 | ||
146 | <listitem> | |
147 | <para>When listing units, also show units of local | |
148 | containers. Units of local containers will be prefixed with | |
149 | the container name, separated by a single colon character | |
150 | (<literal>:</literal>).</para> | |
151 | </listitem> | |
152 | </varlistentry> | |
153 | ||
afba4199 ZJS |
154 | <varlistentry> |
155 | <term><option>--reverse</option></term> | |
156 | ||
157 | <listitem> | |
158 | <para>Show reverse dependencies between units with | |
f6375e83 ZJS |
159 | <command>list-dependencies</command>, i.e. follow |
160 | dependencies of type <varname>WantedBy=</varname>, | |
161 | <varname>RequiredBy=</varname>, | |
f6375e83 ZJS |
162 | <varname>PartOf=</varname>, <varname>BoundBy=</varname>, |
163 | instead of <varname>Wants=</varname> and similar. | |
afba4199 ZJS |
164 | </para> |
165 | </listitem> | |
166 | </varlistentry> | |
167 | ||
168 | <varlistentry> | |
169 | <term><option>--after</option></term> | |
9029f642 JSJ |
170 | |
171 | <listitem> | |
172 | <para>With <command>list-dependencies</command>, show the | |
173 | units that are ordered before the specified unit. In other | |
f6375e83 ZJS |
174 | words, recursively list units following the |
175 | <varname>After=</varname> dependency.</para> | |
176 | ||
177 | <para>Note that any <varname>After=</varname> dependency is | |
178 | automatically mirrored to create a | |
179 | <varname>Before=</varname> dependency. Temporal dependencies | |
922d948b | 180 | may be specified explicitly, but are also created implicitly |
f6375e83 ZJS |
181 | for units which are <varname>WantedBy=</varname> targets |
182 | (see | |
183 | <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>), | |
184 | and as a result of other directives (for example | |
185 | <varname>RequiresMountsFor=</varname>). Both explicitly | |
186 | and implicitly introduced dependencies are shown with | |
187 | <command>list-dependencies</command>.</para> | |
82948f6c LP |
188 | |
189 | <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs are | |
190 | waiting for it. May be combined with <option>--before</option> to show both the jobs waiting for each job as | |
191 | well as all jobs each job is waiting for.</para> | |
9029f642 JSJ |
192 | </listitem> |
193 | </varlistentry> | |
194 | ||
195 | <varlistentry> | |
afba4199 ZJS |
196 | <term><option>--before</option></term> |
197 | ||
198 | <listitem> | |
9029f642 JSJ |
199 | <para>With <command>list-dependencies</command>, show the |
200 | units that are ordered after the specified unit. In other | |
f6375e83 ZJS |
201 | words, recursively list units following the |
202 | <varname>Before=</varname> dependency.</para> | |
82948f6c LP |
203 | |
204 | <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs it | |
205 | is waiting for. May be combined with <option>--after</option> to show both the jobs waiting for each job as | |
206 | well as all jobs each job is waiting for.</para> | |
afba4199 ZJS |
207 | </listitem> |
208 | </varlistentry> | |
209 | ||
4a6022f0 | 210 | <varlistentry> |
98a6e132 | 211 | <term><option>-l</option></term> |
4a6022f0 ZJS |
212 | <term><option>--full</option></term> |
213 | ||
214 | <listitem> | |
69d918b0 ZJS |
215 | <para>Do not ellipsize unit names, process tree entries, |
216 | journal output, or truncate unit descriptions in the output | |
217 | of <command>status</command>, <command>list-units</command>, | |
218 | <command>list-jobs</command>, and | |
219 | <command>list-timers</command>.</para> | |
3b3557c4 JS |
220 | <para>Also, show installation targets in the output of |
221 | <command>is-enabled</command>.</para> | |
4a6022f0 ZJS |
222 | </listitem> |
223 | </varlistentry> | |
224 | ||
4f9a9105 ZJS |
225 | <varlistentry> |
226 | <term><option>--value</option></term> | |
227 | ||
228 | <listitem> | |
229 | <para>When printing properties with <command>show</command>, | |
230 | only print the value, and skip the property name and | |
231 | <literal>=</literal>.</para> | |
232 | </listitem> | |
233 | </varlistentry> | |
234 | ||
991f2a39 ZJS |
235 | <varlistentry> |
236 | <term><option>--show-types</option></term> | |
237 | ||
238 | <listitem> | |
239 | <para>When showing sockets, show the type of the socket.</para> | |
240 | </listitem> | |
241 | </varlistentry> | |
242 | ||
23ade460 | 243 | <varlistentry> |
4dc5b821 | 244 | <term><option>--job-mode=</option></term> |
23ade460 MS |
245 | |
246 | <listitem> | |
e0e009c0 JE |
247 | <para>When queuing a new job, this option controls how to deal with |
248 | already queued jobs. It takes one of <literal>fail</literal>, | |
4dc5b821 LP |
249 | <literal>replace</literal>, |
250 | <literal>replace-irreversibly</literal>, | |
251 | <literal>isolate</literal>, | |
252 | <literal>ignore-dependencies</literal>, | |
253 | <literal>ignore-requirements</literal> or | |
254 | <literal>flush</literal>. Defaults to | |
255 | <literal>replace</literal>, except when the | |
256 | <command>isolate</command> command is used which implies the | |
257 | <literal>isolate</literal> job mode.</para> | |
258 | ||
259 | <para>If <literal>fail</literal> is specified and a requested | |
260 | operation conflicts with a pending job (more specifically: | |
261 | causes an already pending start job to be reversed into a stop | |
262 | job or vice versa), cause the operation to fail.</para> | |
263 | ||
264 | <para>If <literal>replace</literal> (the default) is | |
265 | specified, any conflicting pending job will be replaced, as | |
266 | necessary.</para> | |
267 | ||
268 | <para>If <literal>replace-irreversibly</literal> is specified, | |
269 | operate like <literal>replace</literal>, but also mark the new | |
270 | jobs as irreversible. This prevents future conflicting | |
9a92e77e DS |
271 | transactions from replacing these jobs (or even being enqueued |
272 | while the irreversible jobs are still pending). Irreversible | |
273 | jobs can still be cancelled using the <command>cancel</command> | |
d60cb656 AJ |
274 | command. This job mode should be used on any transaction which |
275 | pulls in <filename>shutdown.target</filename>.</para> | |
4dc5b821 LP |
276 | |
277 | <para><literal>isolate</literal> is only valid for start | |
278 | operations and causes all other units to be stopped when the | |
279 | specified unit is started. This mode is always used when the | |
280 | <command>isolate</command> command is used.</para> | |
281 | ||
282 | <para><literal>flush</literal> will cause all queued jobs to | |
283 | be canceled when the new job is enqueued.</para> | |
284 | ||
285 | <para>If <literal>ignore-dependencies</literal> is specified, | |
286 | then all unit dependencies are ignored for this new job and | |
287 | the operation is executed immediately. If passed, no required | |
288 | units of the unit passed will be pulled in, and no ordering | |
289 | dependencies will be honored. This is mostly a debugging and | |
290 | rescue tool for the administrator and should not be used by | |
291 | applications.</para> | |
292 | ||
293 | <para><literal>ignore-requirements</literal> is similar to | |
b040723e | 294 | <literal>ignore-dependencies</literal>, but only causes the |
4dc5b821 | 295 | requirement dependencies to be ignored, the ordering |
2dd67817 | 296 | dependencies will still be honored.</para> |
23ade460 | 297 | </listitem> |
4a6022f0 | 298 | |
4a6022f0 ZJS |
299 | </varlistentry> |
300 | ||
ac5e3a50 JS |
301 | <varlistentry> |
302 | <term><option>--fail</option></term> | |
303 | ||
304 | <listitem> | |
305 | <para>Shorthand for <option>--job-mode=</option>fail.</para> | |
306 | <para>When used with the <command>kill</command> command, | |
307 | if no units were killed, the operation results in an error. | |
308 | </para> | |
309 | </listitem> | |
310 | </varlistentry> | |
311 | ||
4a6022f0 ZJS |
312 | <varlistentry> |
313 | <term><option>-i</option></term> | |
314 | <term><option>--ignore-inhibitors</option></term> | |
315 | ||
316 | <listitem> | |
317 | <para>When system shutdown or a sleep state is requested, | |
318 | ignore inhibitor locks. Applications can establish inhibitor | |
319 | locks to avoid that certain important operations (such as CD | |
320 | burning or suchlike) are interrupted by system shutdown or a | |
321 | sleep state. Any user may take these locks and privileged | |
322 | users may override these locks. If any locks are taken, | |
323 | shutdown and sleep state requests will normally fail | |
494a6682 | 324 | (regardless of whether privileged or not) and a list of active locks |
7b870f60 JE |
325 | is printed. However, if <option>--ignore-inhibitors</option> |
326 | is specified, the locks are ignored and not printed, and the | |
4a6022f0 ZJS |
327 | operation attempted anyway, possibly requiring additional |
328 | privileges.</para> | |
329 | </listitem> | |
330 | </varlistentry> | |
331 | ||
1ae17672 ZJS |
332 | <varlistentry> |
333 | <term><option>--dry-run</option></term> | |
334 | ||
335 | <listitem> | |
336 | <para>Just print what would be done. Currently supported by verbs | |
337 | <command>halt</command>, <command>poweroff</command>, <command>reboot</command>, | |
338 | <command>kexec</command>, <command>suspend</command>, | |
339 | <command>hibernate</command>, <command>hybrid-sleep</command>, | |
340 | <command>default</command>, <command>rescue</command>, | |
341 | <command>emergency</command>, and <command>exit</command>.</para> | |
342 | </listitem> | |
343 | </varlistentry> | |
344 | ||
4a6022f0 ZJS |
345 | <varlistentry> |
346 | <term><option>-q</option></term> | |
347 | <term><option>--quiet</option></term> | |
348 | ||
349 | <listitem> | |
bbd46aad ZJS |
350 | <para>Suppress printing of the results of various commands |
351 | and also the hints about truncated log lines. This does not | |
352 | suppress output of commands for which the printed output is | |
353 | the only result (like <command>show</command>). Errors are | |
354 | always printed.</para> | |
4a6022f0 ZJS |
355 | </listitem> |
356 | </varlistentry> | |
357 | ||
358 | <varlistentry> | |
359 | <term><option>--no-block</option></term> | |
360 | ||
361 | <listitem> | |
362 | <para>Do not synchronously wait for the requested operation | |
7b870f60 | 363 | to finish. If this is not specified, the job will be |
4a6022f0 | 364 | verified, enqueued and <command>systemctl</command> will |
3d161f99 | 365 | wait until the unit's start-up is completed. By passing this |
93a08841 MP |
366 | argument, it is only verified and enqueued. This option may not be |
367 | combined with <option>--wait</option>.</para> | |
368 | </listitem> | |
369 | </varlistentry> | |
370 | ||
371 | <varlistentry> | |
372 | <term><option>--wait</option></term> | |
373 | ||
374 | <listitem> | |
375 | <para>Synchronously wait for started units to terminate again. | |
376 | This option may not be combined with <option>--no-block</option>. | |
377 | Note that this will wait forever if any given unit never terminates | |
378 | (by itself or by getting stopped explicitly); particularly services | |
379 | which use <literal>RemainAfterExit=yes</literal>.</para> | |
4a6022f0 ZJS |
380 | </listitem> |
381 | </varlistentry> | |
382 | ||
88ae7333 ZJS |
383 | <xi:include href="user-system-options.xml" xpointer="user" /> |
384 | <xi:include href="user-system-options.xml" xpointer="system" /> | |
4a6022f0 | 385 | |
bef19548 ZJS |
386 | <varlistentry> |
387 | <term><option>--failed</option></term> | |
388 | ||
389 | <listitem> | |
390 | <para>List units in failed state. This is equivalent to | |
391 | <option>--state=failed</option>.</para> | |
392 | </listitem> | |
393 | </varlistentry> | |
599b6322 | 394 | |
4a6022f0 ZJS |
395 | <varlistentry> |
396 | <term><option>--no-wall</option></term> | |
397 | ||
398 | <listitem> | |
6324a8a7 | 399 | <para>Do not send wall message before halt, power-off and reboot.</para> |
4a6022f0 ZJS |
400 | </listitem> |
401 | </varlistentry> | |
402 | ||
403 | <varlistentry> | |
404 | <term><option>--global</option></term> | |
405 | ||
406 | <listitem> | |
407 | <para>When used with <command>enable</command> and | |
408 | <command>disable</command>, operate on the global user | |
409 | configuration directory, thus enabling or disabling a unit | |
410 | file globally for all future logins of all users.</para> | |
411 | </listitem> | |
412 | </varlistentry> | |
413 | ||
414 | <varlistentry> | |
415 | <term><option>--no-reload</option></term> | |
416 | ||
417 | <listitem> | |
418 | <para>When used with <command>enable</command> and | |
419 | <command>disable</command>, do not implicitly reload daemon | |
420 | configuration after executing the changes.</para> | |
421 | </listitem> | |
422 | </varlistentry> | |
423 | ||
424 | <varlistentry> | |
425 | <term><option>--no-ask-password</option></term> | |
426 | ||
427 | <listitem> | |
428 | <para>When used with <command>start</command> and related | |
429 | commands, disables asking for passwords. Background services | |
430 | may require input of a password or passphrase string, for | |
431 | example to unlock system hard disks or cryptographic | |
432 | certificates. Unless this option is specified and the | |
7b870f60 | 433 | command is invoked from a terminal, |
4a6022f0 ZJS |
434 | <command>systemctl</command> will query the user on the |
435 | terminal for the necessary secrets. Use this option to | |
7b870f60 | 436 | switch this behavior off. In this case, the password must be |
4a6022f0 ZJS |
437 | supplied by some other means (for example graphical password |
438 | agents) or the service might fail. This also disables | |
439 | querying the user for authentication for privileged | |
440 | operations.</para> | |
441 | </listitem> | |
4a6022f0 ZJS |
442 | </varlistentry> |
443 | ||
444 | <varlistentry> | |
445 | <term><option>--kill-who=</option></term> | |
446 | ||
447 | <listitem> | |
448 | <para>When used with <command>kill</command>, choose which | |
af7424af LP |
449 | processes to send a signal to. Must be one of |
450 | <option>main</option>, <option>control</option> or | |
451 | <option>all</option> to select whether to kill only the main | |
452 | process, the control process or all processes of the | |
453 | unit. The main process of the unit is the one that defines | |
454 | the life-time of it. A control process of a unit is one that | |
455 | is invoked by the manager to induce state changes of it. For | |
456 | example, all processes started due to the | |
457 | <varname>ExecStartPre=</varname>, | |
458 | <varname>ExecStop=</varname> or | |
459 | <varname>ExecReload=</varname> settings of service units are | |
460 | control processes. Note that there is only one control | |
461 | process per unit at a time, as only one state change is | |
462 | executed at a time. For services of type | |
b8bde116 | 463 | <varname>Type=forking</varname>, the initial process started |
af7424af LP |
464 | by the manager for <varname>ExecStart=</varname> is a |
465 | control process, while the process ultimately forked off by | |
466 | that one is then considered the main process of the unit (if | |
467 | it can be determined). This is different for service units | |
468 | of other types, where the process forked off by the manager | |
469 | for <varname>ExecStart=</varname> is always the main process | |
b8bde116 JE |
470 | itself. A service unit consists of zero or one main process, |
471 | zero or one control process plus any number of additional | |
af7424af | 472 | processes. Not all unit types manage processes of these |
b8bde116 | 473 | types however. For example, for mount units, control processes |
af7424af | 474 | are defined (which are the invocations of |
d31dd62b FB |
475 | <filename>&MOUNT_PATH;</filename> and |
476 | <filename>&UMOUNT_PATH;</filename>), but no main process | |
af7424af LP |
477 | is defined. If omitted, defaults to |
478 | <option>all</option>.</para> | |
4a6022f0 ZJS |
479 | </listitem> |
480 | ||
481 | </varlistentry> | |
482 | ||
483 | <varlistentry> | |
484 | <term><option>-s</option></term> | |
485 | <term><option>--signal=</option></term> | |
486 | ||
487 | <listitem> | |
488 | <para>When used with <command>kill</command>, choose which | |
489 | signal to send to selected processes. Must be one of the | |
b938cb90 | 490 | well-known signal specifiers such as <constant>SIGTERM</constant>, <constant>SIGINT</constant> or |
7b870f60 | 491 | <constant>SIGSTOP</constant>. If omitted, defaults to |
4a6022f0 ZJS |
492 | <option>SIGTERM</option>.</para> |
493 | </listitem> | |
494 | </varlistentry> | |
495 | ||
496 | <varlistentry> | |
497 | <term><option>-f</option></term> | |
498 | <term><option>--force</option></term> | |
499 | ||
500 | <listitem> | |
501 | <para>When used with <command>enable</command>, overwrite | |
502 | any existing conflicting symlinks.</para> | |
503 | ||
39c38ce1 DC |
504 | <para>When used with <command>edit</command>, create all of the |
505 | specified units which do not already exist.</para> | |
506 | ||
924e44b4 LP |
507 | <para>When used with <command>halt</command>, <command>poweroff</command>, <command>reboot</command> or |
508 | <command>kexec</command>, execute the selected operation without shutting down all units. However, all | |
509 | processes will be killed forcibly and all file systems are unmounted or remounted read-only. This is hence a | |
510 | drastic but relatively safe option to request an immediate reboot. If <option>--force</option> is specified | |
511 | twice for these operations (with the exception of <command>kexec</command>), they will be executed | |
512 | immediately, without terminating any processes or unmounting any file systems. Warning: specifying | |
513 | <option>--force</option> twice with any of these operations might result in data loss. Note that when | |
514 | <option>--force</option> is specified twice the selected operation is executed by | |
515 | <command>systemctl</command> itself, and the system manager is not contacted. This means the command should | |
6324a8a7 | 516 | succeed even when the system manager has crashed.</para> |
4a6022f0 ZJS |
517 | </listitem> |
518 | </varlistentry> | |
519 | ||
9ef15026 JS |
520 | <varlistentry> |
521 | <term><option>--message=</option></term> | |
522 | ||
523 | <listitem> | |
6324a8a7 LP |
524 | <para>When used with <command>halt</command>, <command>poweroff</command> or <command>reboot</command>, set a |
525 | short message explaining the reason for the operation. The message will be logged together with the default | |
526 | shutdown message.</para> | |
9ef15026 JS |
527 | </listitem> |
528 | </varlistentry> | |
529 | ||
57ab2eab JS |
530 | <varlistentry> |
531 | <term><option>--now</option></term> | |
532 | ||
533 | <listitem> | |
534 | <para>When used with <command>enable</command>, the units | |
535 | will also be started. When used with <command>disable</command> or | |
536 | <command>mask</command>, the units will also be stopped. The start | |
537 | or stop operation is only carried out when the respective enable or | |
538 | disable operation has been successful.</para> | |
539 | </listitem> | |
540 | </varlistentry> | |
541 | ||
4a6022f0 ZJS |
542 | <varlistentry> |
543 | <term><option>--root=</option></term> | |
544 | ||
545 | <listitem> | |
546 | <para>When used with | |
547 | <command>enable</command>/<command>disable</command>/<command>is-enabled</command> | |
9b914a9d ZJS |
548 | (and related commands), use the specified root path when looking for unit |
549 | files. If this option is present, <command>systemctl</command> will operate on | |
550 | the file system directly, instead of communicating with the <command>systemd</command> | |
551 | daemon to carry out changes.</para> | |
4a6022f0 ZJS |
552 | </listitem> |
553 | ||
554 | </varlistentry> | |
555 | ||
556 | <varlistentry> | |
557 | <term><option>--runtime</option></term> | |
558 | ||
559 | <listitem> | |
4910b350 ZJS |
560 | <para>When used with <command>set-property</command>, make changes only |
561 | temporarily, so that they are lost on the next reboot.</para> | |
562 | ||
563 | <para>Similarily, when used with <command>enable</command>, <command>mask</command>, | |
564 | <command>edit</command> and related commands, make temporary changes, which are lost on | |
565 | the next reboot. Changes are not made in subdirectories of <filename>/etc</filename>, but | |
566 | in <filename>/run</filename>. The immediate effect is identical, however since the latter | |
4a6022f0 | 567 | is lost on reboot, the changes are lost too.</para> |
a330b376 | 568 | |
4910b350 ZJS |
569 | <para>Note: this option cannot be used with <command>disable</command>, |
570 | <command>unmask</command>, <command>preset</command>, or <command>preset-all</command>, | |
571 | because those operations sometimes need to remove symlinks under <filename>/etc</filename> | |
572 | to have the desired effect, which would cause a persistent change.</para> | |
4a6022f0 ZJS |
573 | </listitem> |
574 | </varlistentry> | |
575 | ||
d309c1c3 LP |
576 | <varlistentry> |
577 | <term><option>--preset-mode=</option></term> | |
578 | ||
579 | <listitem> | |
580 | <para>Takes one of <literal>full</literal> (the default), | |
581 | <literal>enable-only</literal>, | |
8d0e0ddd | 582 | <literal>disable-only</literal>. When used with the |
d309c1c3 | 583 | <command>preset</command> or <command>preset-all</command> |
8d0e0ddd | 584 | commands, controls whether units shall be disabled and |
d309c1c3 LP |
585 | enabled according to the preset rules, or only enabled, or |
586 | only disabled.</para> | |
587 | </listitem> | |
588 | </varlistentry> | |
589 | ||
4a6022f0 ZJS |
590 | <varlistentry> |
591 | <term><option>-n</option></term> | |
592 | <term><option>--lines=</option></term> | |
593 | ||
594 | <listitem> | |
7b870f60 | 595 | <para>When used with <command>status</command>, controls the |
4a6022f0 ZJS |
596 | number of journal lines to show, counting from the most |
597 | recent ones. Takes a positive integer argument. Defaults to | |
598 | 10.</para> | |
599 | </listitem> | |
600 | </varlistentry> | |
601 | ||
602 | <varlistentry> | |
603 | <term><option>-o</option></term> | |
604 | <term><option>--output=</option></term> | |
605 | ||
606 | <listitem> | |
7b870f60 | 607 | <para>When used with <command>status</command>, controls the |
4a6022f0 | 608 | formatting of the journal entries that are shown. For the |
7b870f60 | 609 | available choices, see |
4a6022f0 ZJS |
610 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>. |
611 | Defaults to <literal>short</literal>.</para> | |
612 | </listitem> | |
613 | </varlistentry> | |
614 | ||
5bdf2243 JJ |
615 | <varlistentry> |
616 | <term><option>--firmware-setup</option></term> | |
617 | ||
618 | <listitem> | |
619 | <para>When used with the <command>reboot</command> command, | |
620 | indicate to the system's firmware to boot into setup | |
621 | mode. Note that this is currently only supported on some EFI | |
622 | systems and only if the system was booted in EFI | |
623 | mode.</para> | |
624 | </listitem> | |
625 | </varlistentry> | |
626 | ||
5d0c05e5 LN |
627 | <varlistentry> |
628 | <term><option>--plain</option></term> | |
629 | ||
630 | <listitem> | |
7b870f60 | 631 | <para>When used with <command>list-dependencies</command>, |
831d3dc8 | 632 | <command>list-units</command> or <command>list-machines</command>, |
a20e43c0 MT |
633 | the output is printed as a list instead of a tree, and the bullet |
634 | circles are omitted.</para> | |
5d0c05e5 LN |
635 | </listitem> |
636 | </varlistentry> | |
637 | ||
4f50d2ef ZJS |
638 | <xi:include href="user-system-options.xml" xpointer="host" /> |
639 | <xi:include href="user-system-options.xml" xpointer="machine" /> | |
640 | ||
12f15e59 ZJS |
641 | <xi:include href="standard-options.xml" xpointer="no-pager" /> |
642 | <xi:include href="standard-options.xml" xpointer="no-legend" /> | |
dfdebb1b ZJS |
643 | <xi:include href="standard-options.xml" xpointer="help" /> |
644 | <xi:include href="standard-options.xml" xpointer="version" /> | |
4a6022f0 ZJS |
645 | </variablelist> |
646 | </refsect1> | |
647 | ||
648 | <refsect1> | |
649 | <title>Commands</title> | |
650 | ||
651 | <para>The following commands are understood:</para> | |
652 | ||
27722f96 LN |
653 | <refsect2> |
654 | <title>Unit Commands</title> | |
4a6022f0 | 655 | |
27722f96 LN |
656 | <variablelist> |
657 | <varlistentry> | |
1eecafb8 | 658 | <term><command>list-units <optional><replaceable>PATTERN</replaceable>…</optional></command></term> |
4a6022f0 | 659 | |
27722f96 | 660 | <listitem> |
2cdbbc9a LP |
661 | <para>List units that <command>systemd</command> currently has in memory. This includes units that are |
662 | either referenced directly or through a dependency, units that are pinned by applications programmatically, | |
663 | or units that were active in the past and have failed. By default only units which are active, have pending | |
664 | jobs, or have failed are shown; this can be changed with option <option>--all</option>. If one or more | |
05a98afd LP |
665 | <replaceable>PATTERN</replaceable>s are specified, only units matching one of them are shown. The units |
666 | that are shown are additionally filtered by <option>--type=</option> and <option>--state=</option> if those | |
667 | options are specified.</para> | |
991f2a39 | 668 | |
6fdbb3c8 ZJS |
669 | <para>Produces output similar to |
670 | <programlisting> UNIT LOAD ACTIVE SUB DESCRIPTION | |
671 | sys-module-fuse.device loaded active plugged /sys/module/fuse | |
672 | -.mount loaded active mounted Root Mount | |
673 | boot-efi.mount loaded active mounted /boot/efi | |
674 | systemd-journald.service loaded active running Journal Service | |
675 | systemd-logind.service loaded active running Login Service | |
676 | ● user@1000.service loaded active running User Manager for UID 1000 | |
24c44fdf | 677 | … |
6fdbb3c8 ZJS |
678 | systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories |
679 | ||
680 | LOAD = Reflects whether the unit definition was properly loaded. | |
681 | ACTIVE = The high-level unit activation state, i.e. generalization of SUB. | |
682 | SUB = The low-level unit activation state, values depend on unit type. | |
683 | ||
684 | 123 loaded units listed. Pass --all to see loaded but inactive units, too. | |
685 | To show all installed unit files use 'systemctl list-unit-files'. | |
686 | </programlisting> | |
687 | The header and the last unit of a given type are underlined if the | |
688 | terminal supports that. A colored dot is shown next to services which | |
689 | were masked, not found, or otherwise failed.</para> | |
690 | ||
443dee9d | 691 | <para>The LOAD column shows the load state, one of <constant>loaded</constant>, |
c4555ad8 LP |
692 | <constant>not-found</constant>, <constant>bad-setting</constant>, <constant>error</constant>, |
693 | <constant>masked</constant>. The ACTIVE columns shows the general unit state, one of | |
694 | <constant>active</constant>, <constant>reloading</constant>, <constant>inactive</constant>, | |
695 | <constant>failed</constant>, <constant>activating</constant>, <constant>deactivating</constant>. The SUB | |
696 | column shows the unit-type-specific detailed state of the unit, possible values vary by unit type. The list | |
697 | of possible LOAD, ACTIVE, and SUB states is not constant and new systemd releases may both add and remove | |
698 | values. <programlisting>systemctl --state=help</programlisting> command maybe be used to display the | |
699 | current set of possible values.</para> | |
6fdbb3c8 | 700 | |
27722f96 LN |
701 | <para>This is the default command.</para> |
702 | </listitem> | |
703 | </varlistentry> | |
991f2a39 | 704 | |
27722f96 | 705 | <varlistentry> |
1eecafb8 | 706 | <term><command>list-sockets <optional><replaceable>PATTERN</replaceable>…</optional></command></term> |
27722f96 LN |
707 | |
708 | <listitem> | |
2cdbbc9a LP |
709 | <para>List socket units currently in memory, ordered by listening address. If one or more |
710 | <replaceable>PATTERN</replaceable>s are specified, only socket units matching one of them are | |
d8fba7c6 | 711 | shown. Produces output similar to |
27722f96 | 712 | <programlisting> |
991f2a39 ZJS |
713 | LISTEN UNIT ACTIVATES |
714 | /dev/initctl systemd-initctl.socket systemd-initctl.service | |
1eecafb8 | 715 | … |
991f2a39 ZJS |
716 | [::]:22 sshd.socket sshd.service |
717 | kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service | |
718 | ||
9fccdb0f | 719 | 5 sockets listed.</programlisting> |
27722f96 LN |
720 | Note: because the addresses might contains spaces, this output |
721 | is not suitable for programmatic consumption. | |
722 | </para> | |
723 | ||
2cdbbc9a | 724 | <para>Also see <option>--show-types</option>, <option>--all</option>, and <option>--state=</option>.</para> |
27722f96 LN |
725 | </listitem> |
726 | </varlistentry> | |
727 | ||
cbb76c29 | 728 | <varlistentry> |
1eecafb8 | 729 | <term><command>list-timers <optional><replaceable>PATTERN</replaceable>…</optional></command></term> |
cbb76c29 LP |
730 | |
731 | <listitem> | |
2cdbbc9a LP |
732 | <para>List timer units currently in memory, ordered by the time they elapse next. If one or more |
733 | <replaceable>PATTERN</replaceable>s are specified, only units matching one of them are shown. | |
3c3fff44 | 734 | Produces output similar to |
ccdda955 MS |
735 | <programlisting> |
736 | NEXT LEFT LAST PASSED UNIT ACTIVATES | |
737 | n/a n/a Thu 2017-02-23 13:40:29 EST 3 days ago ureadahead-stop.timer ureadahead-stop.service | |
738 | Sun 2017-02-26 18:55:42 EST 1min 14s left Thu 2017-02-23 13:54:44 EST 3 days ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service | |
739 | Sun 2017-02-26 20:37:16 EST 1h 42min left Sun 2017-02-26 11:56:36 EST 6h ago apt-daily.timer apt-daily.service | |
740 | Sun 2017-02-26 20:57:49 EST 2h 3min left Sun 2017-02-26 11:56:36 EST 6h ago snapd.refresh.timer snapd.refresh.service | |
741 | </programlisting> | |
d8fba7c6 | 742 | </para> |
cbb76c29 | 743 | |
ccdda955 MS |
744 | <para><emphasis>NEXT</emphasis> shows the next time the timer will run.</para> |
745 | <para><emphasis>LEFT</emphasis> shows how long till the next time the timer runs.</para> | |
746 | <para><emphasis>LAST</emphasis> shows the last time the timer ran.</para> | |
7456fa02 | 747 | <para><emphasis>PASSED</emphasis> shows how long has passed since the timer last ran.</para> |
ccdda955 | 748 | <para><emphasis>UNIT</emphasis> shows the name of the timer</para> |
785889e5 | 749 | <para><emphasis>ACTIVATES</emphasis> shows the name the service the timer activates when it runs.</para> |
ccdda955 | 750 | |
2cdbbc9a | 751 | <para>Also see <option>--all</option> and <option>--state=</option>.</para> |
cbb76c29 LP |
752 | </listitem> |
753 | </varlistentry> | |
754 | ||
27722f96 | 755 | <varlistentry> |
1eecafb8 | 756 | <term><command>start <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
757 | |
758 | <listitem> | |
759 | <para>Start (activate) one or more units specified on the | |
760 | command line.</para> | |
e3e0314b | 761 | |
2cdbbc9a LP |
762 | <para>Note that glob patterns operate on the set of primary names of units currently in memory. Units which |
763 | are not active and are not in a failed state usually are not in memory, and will not be matched by any | |
1f00eded LP |
764 | pattern. In addition, in case of instantiated units, systemd is often unaware of the instance name until |
765 | the instance has been started. Therefore, using glob patterns with <command>start</command> has limited | |
766 | usefulness. Also, secondary alias names of units are not considered.</para> | |
27722f96 LN |
767 | </listitem> |
768 | </varlistentry> | |
769 | <varlistentry> | |
1eecafb8 | 770 | <term><command>stop <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
771 | |
772 | <listitem> | |
773 | <para>Stop (deactivate) one or more units specified on the | |
774 | command line.</para> | |
775 | </listitem> | |
776 | </varlistentry> | |
777 | <varlistentry> | |
1eecafb8 | 778 | <term><command>reload <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
779 | |
780 | <listitem> | |
781 | <para>Asks all units listed on the command line to reload | |
782 | their configuration. Note that this will reload the | |
783 | service-specific configuration, not the unit configuration | |
784 | file of systemd. If you want systemd to reload the | |
79640424 | 785 | configuration file of a unit, use the |
27722f96 LN |
786 | <command>daemon-reload</command> command. In other words: |
787 | for the example case of Apache, this will reload Apache's | |
788 | <filename>httpd.conf</filename> in the web server, not the | |
789 | <filename>apache.service</filename> systemd unit | |
790 | file.</para> | |
791 | ||
792 | <para>This command should not be confused with the | |
d0a3fb75 | 793 | <command>daemon-reload</command> command.</para> |
27722f96 LN |
794 | </listitem> |
795 | ||
796 | </varlistentry> | |
797 | <varlistentry> | |
1eecafb8 | 798 | <term><command>restart <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
799 | |
800 | <listitem> | |
c4f2aaa4 LP |
801 | <para>Stop and then start one or more units specified on the command line. If the units are not running |
802 | yet, they will be started.</para> | |
803 | ||
804 | <para>Note that restarting a unit with this command does not necessarily flush out all of the unit's | |
805 | resources before it is started again. For example, the per-service file descriptor storage facility (see | |
806 | <varname>FileDescriptoreStoreMax=</varname> in | |
807 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>) will | |
808 | remain intact as long as the unit has a job pending, and is only cleared when the unit is fully stopped and | |
809 | no jobs are pending anymore. If it is intended that the file descriptor store is flushed out, too, during a | |
810 | restart operation an explicit <command>systemctl stop</command> command followed by <command>systemctl | |
811 | start</command> should be issued.</para> | |
27722f96 LN |
812 | </listitem> |
813 | </varlistentry> | |
814 | <varlistentry> | |
1eecafb8 | 815 | <term><command>try-restart <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
816 | |
817 | <listitem> | |
6539dd7c | 818 | <para>Stop and then start one or more units specified on the |
819 | command line if the units are running. This does nothing | |
820 | if units are not running.</para> | |
2fcee0a5 LP |
821 | <!-- Note that we don't document condrestart here, as that is just compatibility support, and we generally |
822 | don't document that. --> | |
27722f96 LN |
823 | </listitem> |
824 | </varlistentry> | |
825 | <varlistentry> | |
1eecafb8 | 826 | <term><command>reload-or-restart <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
827 | |
828 | <listitem> | |
ff946d82 LP |
829 | <para>Reload one or more units if they support it. If not, stop and then start them instead. If the units |
830 | are not running yet, they will be started.</para> | |
27722f96 LN |
831 | </listitem> |
832 | </varlistentry> | |
833 | <varlistentry> | |
1eecafb8 | 834 | <term><command>try-reload-or-restart <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
835 | |
836 | <listitem> | |
ff946d82 LP |
837 | <para>Reload one or more units if they support it. If not, stop and then start them instead. This does |
838 | nothing if the units are not running.</para> | |
2fcee0a5 LP |
839 | <!-- Note that we don't document force-reload here, as that is just compatibility support, and we generally |
840 | don't document that. --> | |
27722f96 LN |
841 | </listitem> |
842 | </varlistentry> | |
843 | <varlistentry> | |
da5e955f | 844 | <term><command>isolate <replaceable>UNIT</replaceable></command></term> |
27722f96 LN |
845 | |
846 | <listitem> | |
26adf774 ZJS |
847 | <para>Start the unit specified on the command line and its dependencies |
848 | and stop all others, unless they have | |
849 | <option>IgnoreOnIsolate=yes</option> (see | |
850 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>). | |
851 | If a unit name with no extension is given, an extension of | |
507e28d8 | 852 | <literal>.target</literal> will be assumed.</para> |
27722f96 LN |
853 | |
854 | <para>This is similar to changing the runlevel in a | |
855 | traditional init system. The <command>isolate</command> | |
856 | command will immediately stop processes that are not enabled | |
857 | in the new unit, possibly including the graphical | |
858 | environment or terminal you are currently using.</para> | |
859 | ||
860 | <para>Note that this is allowed only on units where | |
861 | <option>AllowIsolate=</option> is enabled. See | |
862 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
863 | for details.</para> | |
864 | </listitem> | |
865 | </varlistentry> | |
866 | <varlistentry> | |
1eecafb8 | 867 | <term><command>kill <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
868 | |
869 | <listitem> | |
870 | <para>Send a signal to one or more processes of the | |
871 | unit. Use <option>--kill-who=</option> to select which | |
0088d631 LP |
872 | process to kill. Use <option>--signal=</option> to select |
873 | the signal to send.</para> | |
27722f96 LN |
874 | </listitem> |
875 | </varlistentry> | |
876 | <varlistentry> | |
1eecafb8 | 877 | <term><command>is-active <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
878 | |
879 | <listitem> | |
880 | <para>Check whether any of the specified units are active | |
6db27428 ZJS |
881 | (i.e. running). Returns an exit code |
882 | <constant>0</constant> if at least one is active, or | |
883 | non-zero otherwise. Unless <option>--quiet</option> is | |
884 | specified, this will also print the current unit state to | |
885 | standard output.</para> | |
27722f96 LN |
886 | </listitem> |
887 | </varlistentry> | |
888 | <varlistentry> | |
1eecafb8 | 889 | <term><command>is-failed <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
890 | |
891 | <listitem> | |
6db27428 ZJS |
892 | <para>Check whether any of the specified units are in a |
893 | "failed" state. Returns an exit code | |
894 | <constant>0</constant> if at least one has failed, | |
895 | non-zero otherwise. Unless <option>--quiet</option> is | |
896 | specified, this will also print the current unit state to | |
897 | standard output.</para> | |
27722f96 LN |
898 | </listitem> |
899 | </varlistentry> | |
900 | <varlistentry> | |
1eecafb8 | 901 | <term><command>status</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…]</optional></term> |
27722f96 LN |
902 | |
903 | <listitem> | |
904 | <para>Show terse runtime status information about one or | |
905 | more units, followed by most recent log data from the | |
8fcf784d | 906 | journal. If no units are specified, show system status. If |
b8bde116 | 907 | combined with <option>--all</option>, also show the status of |
8fcf784d LP |
908 | all units (subject to limitations specified with |
909 | <option>-t</option>). If a PID is passed, show information | |
910 | about the unit the process belongs to.</para> | |
27722f96 LN |
911 | |
912 | <para>This function is intended to generate human-readable | |
e213d1a3 | 913 | output. If you are looking for computer-parsable output, |
b938cb90 | 914 | use <command>show</command> instead. By default, this |
e213d1a3 | 915 | function only shows 10 lines of output and ellipsizes |
4559a721 | 916 | lines to fit in the terminal window. This can be changed |
e213d1a3 ZJS |
917 | with <option>--lines</option> and <option>--full</option>, |
918 | see above. In addition, <command>journalctl | |
919 | --unit=<replaceable>NAME</replaceable></command> or | |
920 | <command>journalctl | |
921 | --user-unit=<replaceable>NAME</replaceable></command> use | |
922 | a similar filter for messages and might be more | |
923 | convenient. | |
924 | </para> | |
ab8864eb | 925 | |
f95b0be7 | 926 | <para>systemd implicitly loads units as necessary, so just running the <command>status</command> will |
ab8864eb MS |
927 | attempt to load a file. The command is thus not useful for determining if something was already loaded or |
928 | not. The units may possibly also be quickly unloaded after the operation is completed if there's no reason | |
929 | to keep it in memory thereafter. | |
930 | </para> | |
931 | ||
932 | <example> | |
933 | <title>Example output from systemctl status </title> | |
934 | ||
935 | <programlisting>$ systemctl status bluetooth | |
936 | ● bluetooth.service - Bluetooth service | |
83ddf5d3 | 937 | Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled) |
ab8864eb MS |
938 | Active: active (running) since Wed 2017-01-04 13:54:04 EST; 1 weeks 0 days ago |
939 | Docs: man:bluetoothd(8) | |
940 | Main PID: 930 (bluetoothd) | |
941 | Status: "Running" | |
942 | Tasks: 1 | |
943 | Memory: 648.0K | |
944 | CPU: 435ms | |
945 | CGroup: /system.slice/bluetooth.service | |
946 | └─930 /usr/lib/bluetooth/bluetoothd | |
947 | ||
948 | Jan 12 10:46:45 example.com bluetoothd[8900]: Not enough free handles to register service | |
542ca7c9 DR |
949 | Jan 12 10:46:45 example.com bluetoothd[8900]: Current Time Service could not be registered |
950 | Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output error (5) | |
ab8864eb MS |
951 | </programlisting> |
952 | ||
953 | <para>The dot ("●") uses color on supported terminals to summarize the unit state at a glance. White | |
954 | indicates an <literal>inactive</literal> or <literal>deactivating</literal> state. Red indicates a | |
955 | <literal>failed</literal> or <literal>error</literal> state and green indicates an | |
956 | <literal>active</literal>, <literal>reloading</literal> or <literal>activating</literal> state. | |
957 | </para> | |
958 | ||
959 | <para>The "Loaded:" line in the output will show <literal>loaded</literal> if the unit has been loaded into | |
960 | memory. Other possible values for "Loaded:" include: <literal>error</literal> if there was a problem | |
c4555ad8 LP |
961 | loading it, <literal>not-found</literal> if not unit file was found for this unit, |
962 | <literal>bad-setting</literal> if an essential unit file setting could not be parsed and | |
963 | <literal>masked</literal> if the unit file has been masked. Along with showing the path to the unit file, | |
964 | this line will also show the enablement state. Enabled commands start at boot. See the full table of | |
965 | possible enablement states — including the definition of <literal>masked</literal> — in the documentation | |
966 | for the <command>is-enabled</command> command. | |
ab8864eb MS |
967 | </para> |
968 | ||
969 | <para>The "Active:" line shows active state. The value is usually <literal>active</literal> or | |
970 | <literal>inactive</literal>. Active could mean started, bound, plugged in, etc depending on the unit type. | |
971 | The unit could also be in process of changing states, reporting a state of <literal>activating</literal> or | |
972 | <literal>deactivating</literal>. A special <literal>failed</literal> state is entered when the service | |
973 | failed in some way, such as a crash, exiting with an error code or timing out. If the failed state is | |
974 | entered the cause will be logged for later reference.</para> | |
975 | </example> | |
976 | ||
27722f96 LN |
977 | </listitem> |
978 | </varlistentry> | |
979 | <varlistentry> | |
1eecafb8 | 980 | <term><command>show</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>JOB</replaceable>…</optional></term> |
27722f96 LN |
981 | |
982 | <listitem> | |
33d2308c LP |
983 | <para>Show properties of one or more units, jobs, or the manager itself. If no argument is specified, |
984 | properties of the manager will be shown. If a unit name is specified, properties of the unit are shown, and | |
985 | if a job ID is specified, properties of the job are shown. By default, empty properties are suppressed. Use | |
986 | <option>--all</option> to show those too. To select specific properties to show, use | |
987 | <option>--property=</option>. This command is intended to be used whenever computer-parsable output is | |
988 | required. Use <command>status</command> if you are looking for formatted human-readable output.</para> | |
989 | ||
990 | <para>Many properties shown by <command>systemctl show</command> map directly to configuration settings of | |
991 | the system and service manager and its unit files. Note that the properties shown by the command are | |
992 | generally more low-level, normalized versions of the original configuration settings and expose runtime | |
993 | state in addition to configuration. For example, properties shown for service units include the service's | |
994 | current main process identifier as <literal>MainPID</literal> (which is runtime state), and time settings | |
995 | are always exposed as properties ending in the <literal>…USec</literal> suffix even if a matching | |
996 | configuration options end in <literal>…Sec</literal>, because microseconds is the normalized time unit used | |
997 | by the system and service manager.</para> | |
27722f96 LN |
998 | </listitem> |
999 | </varlistentry> | |
e93c33d4 | 1000 | <varlistentry> |
1eecafb8 | 1001 | <term><command>cat <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 | 1002 | |
e93c33d4 | 1003 | <listitem> |
e4c0fbe5 ZJS |
1004 | <para>Show backing files of one or more units. Prints the |
1005 | "fragment" and "drop-ins" (source files) of units. Each | |
1006 | file is preceded by a comment which includes the file | |
d4a48671 LW |
1007 | name. Note that this shows the contents of the backing files |
1008 | on disk, which may not match the system manager's | |
1009 | understanding of these units if any unit files were | |
1010 | updated on disk and the <command>daemon-reload</command> | |
1011 | command wasn't issued since.</para> | |
e93c33d4 SL |
1012 | </listitem> |
1013 | </varlistentry> | |
27722f96 | 1014 | <varlistentry> |
fbf3283b | 1015 | <term><command>set-property <replaceable>UNIT</replaceable> <replaceable>PROPERTY</replaceable>=<replaceable>VALUE</replaceable>…</command></term> |
27722f96 LN |
1016 | |
1017 | <listitem> | |
1018 | <para>Set the specified unit properties at runtime where | |
1019 | this is supported. This allows changing configuration | |
3fde5f30 | 1020 | parameter properties such as resource control settings at |
27722f96 | 1021 | runtime. Not all properties may be changed at runtime, but |
3fde5f30 LP |
1022 | many resource control settings (primarily those in |
1023 | <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>) | |
fbf3283b | 1024 | may. The changes are applied immediately, and stored on disk |
27722f96 | 1025 | for future boots, unless <option>--runtime</option> is |
3fde5f30 LP |
1026 | passed, in which case the settings only apply until the |
1027 | next reboot. The syntax of the property assignment follows | |
27722f96 LN |
1028 | closely the syntax of assignments in unit files.</para> |
1029 | ||
1030 | <para>Example: <command>systemctl set-property foobar.service CPUShares=777</command></para> | |
1031 | ||
e9fd88f2 FB |
1032 | <para>If the specified unit appears to be inactive, the |
1033 | changes will be only stored on disk as described | |
1034 | previously hence they will be effective when the unit will | |
1035 | be started.</para> | |
1036 | ||
27722f96 LN |
1037 | <para>Note that this command allows changing multiple |
1038 | properties at the same time, which is preferable over | |
fbf3283b ZJS |
1039 | setting them individually. Like with unit file configuration |
1040 | settings, assigning an empty list will reset the property. | |
1041 | </para> | |
27722f96 LN |
1042 | </listitem> |
1043 | </varlistentry> | |
1044 | ||
1045 | <varlistentry> | |
1eecafb8 | 1046 | <term><command>help <replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…</command></term> |
27722f96 LN |
1047 | |
1048 | <listitem> | |
1049 | <para>Show manual pages for one or more units, if | |
1050 | available. If a PID is given, the manual pages for the unit | |
1051 | the process belongs to are shown.</para> | |
1052 | </listitem> | |
1053 | </varlistentry> | |
1054 | ||
1055 | <varlistentry> | |
1eecafb8 | 1056 | <term><command>reset-failed [<replaceable>PATTERN</replaceable>…]</command></term> |
27722f96 LN |
1057 | |
1058 | <listitem> | |
ff946d82 LP |
1059 | <para>Reset the <literal>failed</literal> state of the specified units, or if no unit name is passed, reset |
1060 | the state of all units. When a unit fails in some way (i.e. process exiting with non-zero error code, | |
1061 | terminating abnormally or timing out), it will automatically enter the <literal>failed</literal> state and | |
1062 | its exit code and status is recorded for introspection by the administrator until the service is | |
1063 | stopped/re-started or reset with this command.</para> | |
27722f96 LN |
1064 | </listitem> |
1065 | </varlistentry> | |
1066 | ||
1067 | <varlistentry> | |
f6375e83 ZJS |
1068 | <term> |
1069 | <command>list-dependencies</command> | |
da5e955f | 1070 | <optional><replaceable>UNIT</replaceable></optional> |
f6375e83 | 1071 | </term> |
27722f96 LN |
1072 | |
1073 | <listitem> | |
f6375e83 ZJS |
1074 | <para>Shows units required and wanted by the specified |
1075 | unit. This recursively lists units following the | |
1076 | <varname>Requires=</varname>, | |
f6375e83 | 1077 | <varname>Requisite=</varname>, |
fb30c438 | 1078 | <varname>ConsistsOf=</varname>, |
f6375e83 ZJS |
1079 | <varname>Wants=</varname>, <varname>BindsTo=</varname> |
1080 | dependencies. If no unit is specified, | |
1081 | <filename>default.target</filename> is implied.</para> | |
1082 | ||
1083 | <para>By default, only target units are recursively | |
1084 | expanded. When <option>--all</option> is passed, all other | |
1085 | units are recursively expanded as well.</para> | |
1086 | ||
1087 | <para>Options <option>--reverse</option>, | |
1088 | <option>--after</option>, <option>--before</option> | |
1089 | may be used to change what types of dependencies | |
1090 | are shown.</para> | |
27722f96 LN |
1091 | </listitem> |
1092 | </varlistentry> | |
1093 | </variablelist> | |
1094 | </refsect2> | |
1095 | ||
1096 | <refsect2> | |
1097 | <title>Unit File Commands</title> | |
1098 | ||
1099 | <variablelist> | |
1100 | <varlistentry> | |
1eecafb8 | 1101 | <term><command>list-unit-files <optional><replaceable>PATTERN…</replaceable></optional></command></term> |
27722f96 LN |
1102 | |
1103 | <listitem> | |
3990961d LP |
1104 | <para>List unit files installed on the system, in combination with their enablement state (as reported by |
1105 | <command>is-enabled</command>). If one or more <replaceable>PATTERN</replaceable>s are specified, only unit | |
1106 | files whose name matches one of them are shown (patterns matching unit file system paths are not | |
1107 | supported).</para> | |
27722f96 LN |
1108 | </listitem> |
1109 | </varlistentry> | |
1110 | ||
1111 | <varlistentry> | |
da5e955f | 1112 | <term><command>enable <replaceable>UNIT</replaceable>…</command></term> |
1eecafb8 | 1113 | <term><command>enable <replaceable>PATH</replaceable>…</command></term> |
27722f96 LN |
1114 | |
1115 | <listitem> | |
3990961d LP |
1116 | <para>Enable one or more units or unit instances. This will create a set of symlinks, as encoded in the |
1117 | <literal>[Install]</literal> sections of the indicated unit files. After the symlinks have been created, | |
1118 | the system manager configuration is reloaded (in a way equivalent to <command>daemon-reload</command>), in | |
1119 | order to ensure the changes are taken into account immediately. Note that this does | |
1120 | <emphasis>not</emphasis> have the effect of also starting any of the units being enabled. If this is | |
1121 | desired, combine this command with the <option>--now</option> switch, or invoke <command>start</command> | |
1122 | with appropriate arguments later. Note that in case of unit instance enablement (i.e. enablement of units of | |
1123 | the form <filename>foo@bar.service</filename>), symlinks named the same as instances are created in the | |
2dd67817 | 1124 | unit configuration directory, however they point to the single template unit file they are instantiated |
3990961d LP |
1125 | from.</para> |
1126 | ||
93f07c87 ZJS |
1127 | <para>This command expects either valid unit names (in which case various unit file directories are |
1128 | automatically searched for unit files with appropriate names), or absolute paths to unit files (in which | |
1129 | case these files are read directly). If a specified unit file is located outside of the usual unit file | |
1130 | directories, an additional symlink is created, linking it into the unit configuration path, thus ensuring | |
2f3828e5 ZJS |
1131 | it is found when requested by commands such as <command>start</command>. The file system where the linked |
1132 | unit files are located must be accessible when systemd is started (e.g. anything underneath | |
1133 | <filename>/home</filename> or <filename>/var</filename> is not allowed, unless those directories are | |
1134 | located on the root file system).</para> | |
3990961d LP |
1135 | |
1136 | <para>This command will print the file system operations executed. This output may be suppressed by passing | |
1137 | <option>--quiet</option>. | |
27722f96 LN |
1138 | </para> |
1139 | ||
3990961d LP |
1140 | <para>Note that this operation creates only the symlinks suggested in the <literal>[Install]</literal> |
1141 | section of the unit files. While this command is the recommended way to manipulate the unit configuration | |
1142 | directory, the administrator is free to make additional changes manually by placing or removing symlinks | |
1143 | below this directory. This is particularly useful to create configurations that deviate from the suggested | |
1144 | default installation. In this case, the administrator must make sure to invoke | |
1145 | <command>daemon-reload</command> manually as necessary, in order to ensure the changes are taken into | |
1146 | account. | |
27722f96 LN |
1147 | </para> |
1148 | ||
3990961d LP |
1149 | <para>Enabling units should not be confused with starting (activating) units, as done by the |
1150 | <command>start</command> command. Enabling and starting units is orthogonal: units may be enabled without | |
1151 | being started and started without being enabled. Enabling simply hooks the unit into various suggested | |
1152 | places (for example, so that the unit is automatically started on boot or when a particular kind of | |
1153 | hardware is plugged in). Starting actually spawns the daemon process (in case of service units), or binds | |
1154 | the socket (in case of socket units), and so on.</para> | |
1155 | ||
1156 | <para>Depending on whether <option>--system</option>, <option>--user</option>, <option>--runtime</option>, | |
1157 | or <option>--global</option> is specified, this enables the unit for the system, for the calling user only, | |
1d82e6b3 AJ |
1158 | for only this boot of the system, or for all future logins of all users. Note that in the last case, no |
1159 | systemd daemon configuration is reloaded.</para> | |
3990961d LP |
1160 | |
1161 | <para>Using <command>enable</command> on masked units is not supported and results in an error.</para> | |
27722f96 LN |
1162 | </listitem> |
1163 | </varlistentry> | |
1164 | ||
1165 | <varlistentry> | |
da5e955f | 1166 | <term><command>disable <replaceable>UNIT</replaceable>…</command></term> |
27722f96 LN |
1167 | |
1168 | <listitem> | |
3990961d LP |
1169 | <para>Disables one or more units. This removes all symlinks to the unit files backing the specified units |
1170 | from the unit configuration directory, and hence undoes any changes made by <command>enable</command> or | |
1171 | <command>link</command>. Note that this removes <emphasis>all</emphasis> symlinks to matching unit files, | |
1172 | including manually created symlinks, and not just those actually created by <command>enable</command> or | |
1173 | <command>link</command>. Note that while <command>disable</command> undoes the effect of | |
1174 | <command>enable</command>, the two commands are otherwise not symmetric, as <command>disable</command> may | |
1175 | remove more symlinks than a prior <command>enable</command> invocation of the same unit created.</para> | |
1176 | ||
1177 | <para>This command expects valid unit names only, it does not accept paths to unit files.</para> | |
1178 | ||
1179 | <para>In addition to the units specified as arguments, all units are disabled that are listed in the | |
1180 | <varname>Also=</varname> setting contained in the <literal>[Install]</literal> section of any of the unit | |
1181 | files being operated on.</para> | |
1182 | ||
1183 | <para>This command implicitly reloads the system manager configuration after completing the operation. Note | |
1184 | that this command does not implicitly stop the units that are being disabled. If this is desired, either | |
1185 | combine this command with the <option>--now</option> switch, or invoke the <command>stop</command> command | |
1186 | with appropriate arguments later.</para> | |
1187 | ||
1188 | <para>This command will print information about the file system operations (symlink removals) | |
1189 | executed. This output may be suppressed by passing <option>--quiet</option>. | |
27722f96 LN |
1190 | </para> |
1191 | ||
3990961d LP |
1192 | <para>This command honors <option>--system</option>, <option>--user</option>, <option>--runtime</option> |
1193 | and <option>--global</option> in a similar way as <command>enable</command>.</para> | |
27722f96 LN |
1194 | </listitem> |
1195 | </varlistentry> | |
1196 | ||
b619ec8f | 1197 | <varlistentry> |
da5e955f | 1198 | <term><command>reenable <replaceable>UNIT</replaceable>…</command></term> |
b619ec8f LP |
1199 | |
1200 | <listitem> | |
3990961d LP |
1201 | <para>Reenable one or more units, as specified on the command line. This is a combination of |
1202 | <command>disable</command> and <command>enable</command> and is useful to reset the symlinks a unit file is | |
d903a892 | 1203 | enabled with to the defaults configured in its <literal>[Install]</literal> section. This command expects |
1204 | a unit name only, it does not accept paths to unit files.</para> | |
b619ec8f LP |
1205 | </listitem> |
1206 | </varlistentry> | |
1207 | ||
1208 | <varlistentry> | |
da5e955f | 1209 | <term><command>preset <replaceable>UNIT</replaceable>…</command></term> |
b619ec8f LP |
1210 | |
1211 | <listitem> | |
39207373 ZJS |
1212 | <para>Reset the enable/disable status one or more unit files, as specified on |
1213 | the command line, to the defaults configured in the preset policy files. This | |
1214 | has the same effect as <command>disable</command> or | |
1215 | <command>enable</command>, depending how the unit is listed in the preset | |
1216 | files.</para> | |
b619ec8f | 1217 | |
39207373 ZJS |
1218 | <para>Use <option>--preset-mode=</option> to control whether units shall be |
1219 | enabled and disabled, or only enabled, or only disabled.</para> | |
1220 | ||
1221 | <para>If the unit carries no install information, it will be silently ignored | |
da5e955f | 1222 | by this command. <replaceable>UNIT</replaceable> must be the real unit name, |
d923e42e | 1223 | any alias names are ignored silently.</para> |
b619ec8f | 1224 | |
39207373 | 1225 | <para>For more information on the preset policy format, see |
b619ec8f | 1226 | <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>. |
39207373 | 1227 | For more information on the concept of presets, please consult the |
28a0ad81 | 1228 | <ulink url="https://www.freedesktop.org/wiki/Software/systemd/Preset">Preset</ulink> |
b619ec8f LP |
1229 | document.</para> |
1230 | </listitem> | |
1231 | </varlistentry> | |
1232 | ||
1233 | <varlistentry> | |
1234 | <term><command>preset-all</command></term> | |
1235 | ||
1236 | <listitem> | |
1237 | <para>Resets all installed unit files to the defaults | |
1238 | configured in the preset policy file (see above).</para> | |
1239 | ||
1240 | <para>Use <option>--preset-mode=</option> to control | |
1241 | whether units shall be enabled and disabled, or only | |
1242 | enabled, or only disabled.</para> | |
1243 | </listitem> | |
1244 | </varlistentry> | |
1245 | ||
27722f96 | 1246 | <varlistentry> |
da5e955f | 1247 | <term><command>is-enabled <replaceable>UNIT</replaceable>…</command></term> |
27722f96 LN |
1248 | |
1249 | <listitem> | |
1250 | <para>Checks whether any of the specified unit files are | |
171754aa ZJS |
1251 | enabled (as with <command>enable</command>). Returns an |
1252 | exit code of 0 if at least one is enabled, non-zero | |
1253 | otherwise. Prints the current enable status (see table). | |
1254 | To suppress this output, use <option>--quiet</option>. | |
3b3557c4 | 1255 | To show installation targets, use <option>--full</option>. |
171754aa ZJS |
1256 | </para> |
1257 | ||
1258 | <table> | |
1259 | <title> | |
1260 | <command>is-enabled</command> output | |
1261 | </title> | |
1262 | ||
1263 | <tgroup cols='3'> | |
1264 | <thead> | |
1265 | <row> | |
94f099d8 LP |
1266 | <entry>Name</entry> |
1267 | <entry>Description</entry> | |
1268 | <entry>Exit Code</entry> | |
171754aa ZJS |
1269 | </row> |
1270 | </thead> | |
1271 | <tbody> | |
1272 | <row> | |
1273 | <entry><literal>enabled</literal></entry> | |
5cd8ae31 | 1274 | <entry morerows='1'>Enabled via <filename>.wants/</filename>, <filename>.requires/</filename> or <varname>Alias=</varname> symlinks (permanently in <filename>/etc/systemd/system/</filename>, or transiently in <filename>/run/systemd/system/</filename>).</entry> |
171754aa ZJS |
1275 | <entry morerows='1'>0</entry> |
1276 | </row> | |
1277 | <row> | |
1278 | <entry><literal>enabled-runtime</literal></entry> | |
1279 | </row> | |
1280 | <row> | |
1281 | <entry><literal>linked</literal></entry> | |
48563081 | 1282 | <entry morerows='1'>Made available through one or more symlinks to the unit file (permanently in <filename>/etc/systemd/system/</filename> or transiently in <filename>/run/systemd/system/</filename>), even though the unit file might reside outside of the unit file search path.</entry> |
94f099d8 | 1283 | <entry morerows='1'>> 0</entry> |
171754aa ZJS |
1284 | </row> |
1285 | <row> | |
1286 | <entry><literal>linked-runtime</literal></entry> | |
1287 | </row> | |
1288 | <row> | |
1289 | <entry><literal>masked</literal></entry> | |
48563081 | 1290 | <entry morerows='1'>Completely disabled, so that any start operation on it fails (permanently in <filename>/etc/systemd/system/</filename> or transiently in <filename>/run/systemd/systemd/</filename>).</entry> |
94f099d8 | 1291 | <entry morerows='1'>> 0</entry> |
171754aa ZJS |
1292 | </row> |
1293 | <row> | |
1294 | <entry><literal>masked-runtime</literal></entry> | |
1295 | </row> | |
1296 | <row> | |
1297 | <entry><literal>static</literal></entry> | |
f4139308 | 1298 | <entry>The unit file is not enabled, and has no provisions for enabling in the <literal>[Install]</literal> unit file section.</entry> |
91f0ac7d | 1299 | <entry>0</entry> |
171754aa | 1300 | </row> |
aedd4012 JS |
1301 | <row> |
1302 | <entry><literal>indirect</literal></entry> | |
d9b4b48f | 1303 | <entry>The unit file itself is not enabled, but it has a non-empty <varname>Also=</varname> setting in the <literal>[Install]</literal> unit file section, listing other unit files that might be enabled, or it has an alias under a different name through a symlink that is not specified in Also=. For template unit file, an instance different than the one specified in <varname>DefaultInstance=</varname> is enabled.</entry> |
aedd4012 JS |
1304 | <entry>0</entry> |
1305 | </row> | |
171754aa ZJS |
1306 | <row> |
1307 | <entry><literal>disabled</literal></entry> | |
f4139308 | 1308 | <entry>The unit file is not enabled, but contains an <literal>[Install]</literal> section with installation instructions.</entry> |
94f099d8 | 1309 | <entry>> 0</entry> |
171754aa | 1310 | </row> |
f4139308 LP |
1311 | <row> |
1312 | <entry><literal>generated</literal></entry> | |
1313 | <entry>The unit file was generated dynamically via a generator tool. See <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>. Generated unit files may not be enabled, they are enabled implicitly by their generator.</entry> | |
1314 | <entry>0</entry> | |
1315 | </row> | |
e4fca67f LP |
1316 | <row> |
1317 | <entry><literal>transient</literal></entry> | |
1318 | <entry>The unit file has been created dynamically with the runtime API. Transient units may not be enabled.</entry> | |
1319 | <entry>0</entry> | |
1320 | </row> | |
0ec0deaa LP |
1321 | <row> |
1322 | <entry><literal>bad</literal></entry> | |
f4139308 | 1323 | <entry>The unit file is invalid or another error occurred. Note that <command>is-enabled</command> will not actually return this state, but print an error message instead. However the unit file listing printed by <command>list-unit-files</command> might show it.</entry> |
0ec0deaa LP |
1324 | <entry>> 0</entry> |
1325 | </row> | |
171754aa ZJS |
1326 | </tbody> |
1327 | </tgroup> | |
1328 | </table> | |
1329 | ||
27722f96 LN |
1330 | </listitem> |
1331 | </varlistentry> | |
1332 | ||
27722f96 | 1333 | <varlistentry> |
da5e955f | 1334 | <term><command>mask <replaceable>UNIT</replaceable>…</command></term> |
27722f96 LN |
1335 | |
1336 | <listitem> | |
3990961d LP |
1337 | <para>Mask one or more units, as specified on the command line. This will link these unit files to |
1338 | <filename>/dev/null</filename>, making it impossible to start them. This is a stronger version of | |
1339 | <command>disable</command>, since it prohibits all kinds of activation of the unit, including enablement | |
1340 | and manual activation. Use this option with care. This honors the <option>--runtime</option> option to only | |
1341 | mask temporarily until the next reboot of the system. The <option>--now</option> option may be used to | |
1342 | ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit | |
1343 | file paths.</para> | |
27722f96 LN |
1344 | </listitem> |
1345 | </varlistentry> | |
1346 | ||
1347 | <varlistentry> | |
da5e955f | 1348 | <term><command>unmask <replaceable>UNIT</replaceable>…</command></term> |
27722f96 LN |
1349 | |
1350 | <listitem> | |
3990961d LP |
1351 | <para>Unmask one or more unit files, as specified on the command line. This will undo the effect of |
1352 | <command>mask</command>. This command expects valid unit names only, it does not accept unit file | |
1353 | paths.</para> | |
27722f96 LN |
1354 | </listitem> |
1355 | </varlistentry> | |
1356 | ||
1357 | <varlistentry> | |
1eecafb8 | 1358 | <term><command>link <replaceable>PATH</replaceable>…</command></term> |
27722f96 LN |
1359 | |
1360 | <listitem> | |
3990961d LP |
1361 | <para>Link a unit file that is not in the unit file search paths into the unit file search path. This |
1362 | command expects an absolute path to a unit file. The effect of this may be undone with | |
1363 | <command>disable</command>. The effect of this command is that a unit file is made available for commands | |
2f3828e5 ZJS |
1364 | such as <command>start</command>, even though it is not installed directly in the unit search path. The |
1365 | file system where the linked unit files are located must be accessible when systemd is started | |
1366 | (e.g. anything underneath <filename>/home</filename> or <filename>/var</filename> is not allowed, unless | |
1367 | those directories are located on the root file system).</para> | |
27722f96 LN |
1368 | </listitem> |
1369 | </varlistentry> | |
1370 | ||
344ca755 | 1371 | <varlistentry> |
da5e955f | 1372 | <term><command>revert <replaceable>UNIT</replaceable>…</command></term> |
344ca755 LP |
1373 | |
1374 | <listitem> | |
1375 | <para>Revert one or more unit files to their vendor versions. This command removes drop-in configuration | |
1376 | files that modify the specified units, as well as any user-configured unit file that overrides a matching | |
1377 | vendor supplied unit file. Specifically, for a unit <literal>foo.service</literal> the matching directories | |
1378 | <literal>foo.service.d/</literal> with all their contained files are removed, both below the persistent and | |
1379 | runtime configuration directories (i.e. below <filename>/etc/systemd/system</filename> and | |
1380 | <filename>/run/systemd/system</filename>); if the unit file has a vendor-supplied version (i.e. a unit file | |
b17649ee | 1381 | located below <filename>/usr</filename>) any matching persistent or runtime unit file that overrides it is |
344ca755 LP |
1382 | removed, too. Note that if a unit file has no vendor-supplied version (i.e. is only defined below |
1383 | <filename>/etc/systemd/system</filename> or <filename>/run/systemd/system</filename>, but not in a unit | |
1384 | file stored below <filename>/usr</filename>), then it is not removed. Also, if a unit is masked, it is | |
1385 | unmasked.</para> | |
1386 | ||
1387 | <para>Effectively, this command may be used to undo all changes made with <command>systemctl | |
1388 | edit</command>, <command>systemctl set-property</command> and <command>systemctl mask</command> and puts | |
1389 | the original unit file with its settings back in effect.</para> | |
1390 | </listitem> | |
1391 | </varlistentry> | |
1392 | ||
27722f96 | 1393 | <varlistentry> |
b619ec8f | 1394 | <term><command>add-wants <replaceable>TARGET</replaceable> |
da5e955f | 1395 | <replaceable>UNIT</replaceable>…</command></term> |
b619ec8f | 1396 | <term><command>add-requires <replaceable>TARGET</replaceable> |
da5e955f | 1397 | <replaceable>UNIT</replaceable>…</command></term> |
27722f96 LN |
1398 | |
1399 | <listitem> | |
853382da | 1400 | <para>Adds <literal>Wants=</literal> or <literal>Requires=</literal> |
a8eaaee7 | 1401 | dependencies, respectively, to the specified |
853382da | 1402 | <replaceable>TARGET</replaceable> for one or more units. </para> |
27722f96 | 1403 | |
b619ec8f LP |
1404 | <para>This command honors <option>--system</option>, |
1405 | <option>--user</option>, <option>--runtime</option> and | |
a8eaaee7 | 1406 | <option>--global</option> in a way similar to |
b619ec8f | 1407 | <command>enable</command>.</para> |
27722f96 | 1408 | |
27722f96 LN |
1409 | </listitem> |
1410 | </varlistentry> | |
7d4fb3b1 RC |
1411 | |
1412 | <varlistentry> | |
da5e955f | 1413 | <term><command>edit <replaceable>UNIT</replaceable>…</command></term> |
7d4fb3b1 RC |
1414 | |
1415 | <listitem> | |
1416 | <para>Edit a drop-in snippet or a whole replacement file if | |
1417 | <option>--full</option> is specified, to extend or override the | |
1418 | specified unit.</para> | |
1419 | ||
1420 | <para>Depending on whether <option>--system</option> (the default), | |
1421 | <option>--user</option>, or <option>--global</option> is specified, | |
a8eaaee7 | 1422 | this command creates a drop-in file for each unit either for the system, |
b938cb90 | 1423 | for the calling user, or for all futures logins of all users. Then, |
7d4fb3b1 RC |
1424 | the editor (see the "Environment" section below) is invoked on |
1425 | temporary files which will be written to the real location if the | |
1426 | editor exits successfully.</para> | |
1427 | ||
1428 | <para>If <option>--full</option> is specified, this will copy the | |
1429 | original units instead of creating drop-in files.</para> | |
1430 | ||
39c38ce1 DC |
1431 | <para>If <option>--force</option> is specified and any units do |
1432 | not already exist, new unit files will be opened for editing.</para> | |
1433 | ||
7d4fb3b1 RC |
1434 | <para>If <option>--runtime</option> is specified, the changes will |
1435 | be made temporarily in <filename>/run</filename> and they will be | |
1436 | lost on the next reboot.</para> | |
1437 | ||
b938cb90 JE |
1438 | <para>If the temporary file is empty upon exit, the modification of |
1439 | the related unit is canceled.</para> | |
7d4fb3b1 RC |
1440 | |
1441 | <para>After the units have been edited, systemd configuration is | |
1442 | reloaded (in a way that is equivalent to <command>daemon-reload</command>). | |
1443 | </para> | |
1444 | ||
1445 | <para>Note that this command cannot be used to remotely edit units | |
1446 | and that you cannot temporarily edit units which are in | |
b938cb90 | 1447 | <filename>/etc</filename>, since they take precedence over |
7d4fb3b1 RC |
1448 | <filename>/run</filename>.</para> |
1449 | </listitem> | |
1450 | </varlistentry> | |
b619ec8f LP |
1451 | |
1452 | <varlistentry> | |
1453 | <term><command>get-default</command></term> | |
1454 | ||
1455 | <listitem> | |
1456 | <para>Return the default target to boot into. This returns | |
1457 | the target unit name <filename>default.target</filename> | |
1458 | is aliased (symlinked) to.</para> | |
1459 | </listitem> | |
1460 | </varlistentry> | |
1461 | ||
1462 | <varlistentry> | |
da5e955f | 1463 | <term><command>set-default <replaceable>TARGET</replaceable></command></term> |
b619ec8f LP |
1464 | |
1465 | <listitem> | |
1466 | <para>Set the default target to boot into. This sets | |
1467 | (symlinks) the <filename>default.target</filename> alias | |
1468 | to the given target unit.</para> | |
1469 | </listitem> | |
1470 | </varlistentry> | |
1471 | ||
27722f96 LN |
1472 | </variablelist> |
1473 | </refsect2> | |
1474 | ||
0d292f5e LP |
1475 | <refsect2> |
1476 | <title>Machine Commands</title> | |
1477 | ||
1478 | <variablelist> | |
1479 | <varlistentry> | |
1eecafb8 | 1480 | <term><command>list-machines <optional><replaceable>PATTERN</replaceable>…</optional></command></term> |
0d292f5e LP |
1481 | |
1482 | <listitem> | |
1483 | <para>List the host and all running local containers with | |
1484 | their state. If one or more | |
1485 | <replaceable>PATTERN</replaceable>s are specified, only | |
1486 | containers matching one of them are shown. | |
1487 | </para> | |
1488 | </listitem> | |
1489 | </varlistentry> | |
1490 | </variablelist> | |
1491 | </refsect2> | |
1492 | ||
27722f96 LN |
1493 | <refsect2> |
1494 | <title>Job Commands</title> | |
1495 | ||
1496 | <variablelist> | |
1497 | <varlistentry> | |
1eecafb8 | 1498 | <term><command>list-jobs <optional><replaceable>PATTERN…</replaceable></optional></command></term> |
27722f96 LN |
1499 | |
1500 | <listitem> | |
d8fba7c6 ZJS |
1501 | <para>List jobs that are in progress. If one or more |
1502 | <replaceable>PATTERN</replaceable>s are specified, only | |
1503 | jobs for units matching one of them are shown.</para> | |
82948f6c LP |
1504 | |
1505 | <para>When combined with <option>--after</option> or <option>--before</option> the list is augmented with | |
1506 | information on which other job each job is waiting for, and which other jobs are waiting for it, see | |
1507 | above.</para> | |
27722f96 LN |
1508 | </listitem> |
1509 | </varlistentry> | |
1510 | <varlistentry> | |
1eecafb8 | 1511 | <term><command>cancel <replaceable>JOB</replaceable>…</command></term> |
27722f96 LN |
1512 | |
1513 | <listitem> | |
1514 | <para>Cancel one or more jobs specified on the command line | |
1515 | by their numeric job IDs. If no job ID is specified, cancel | |
1516 | all pending jobs.</para> | |
1517 | </listitem> | |
1518 | </varlistentry> | |
1519 | </variablelist> | |
27722f96 LN |
1520 | </refsect2> |
1521 | ||
1522 | <refsect2> | |
1523 | <title>Environment Commands</title> | |
1524 | ||
1525 | <variablelist> | |
1526 | <varlistentry> | |
1527 | <term><command>show-environment</command></term> | |
1528 | ||
1529 | <listitem> | |
804ee07c ZJS |
1530 | <para>Dump the systemd manager environment block. This is the environment |
1531 | block that is passed to all processes the manager spawns. The environment | |
1532 | block will be dumped in straight-forward form suitable for sourcing into | |
1533 | most shells. If no special characters or whitespace is present in the variable | |
1534 | values, no escaping is performed, and the assignments have the form | |
1535 | <literal>VARIABLE=value</literal>. If whitespace or characters which have | |
1536 | special meaning to the shell are present, dollar-single-quote escaping is | |
1537 | used, and assignments have the form <literal>VARIABLE=$'value'</literal>. | |
1538 | This syntax is known to be supported by | |
1539 | <citerefentry project='die-net'><refentrytitle>bash</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1540 | <citerefentry project='die-net'><refentrytitle>zsh</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1541 | <citerefentry project='die-net'><refentrytitle>ksh</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1542 | and | |
1543 | <citerefentry project='die-net'><refentrytitle>busybox</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s | |
1544 | <citerefentry project='die-net'><refentrytitle>ash</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1545 | but not | |
1546 | <citerefentry project='die-net'><refentrytitle>dash</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
1547 | or | |
1548 | <citerefentry project='die-net'><refentrytitle>fish</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | |
1549 | </para> | |
27722f96 LN |
1550 | </listitem> |
1551 | </varlistentry> | |
1552 | <varlistentry> | |
1eecafb8 | 1553 | <term><command>set-environment <replaceable>VARIABLE=VALUE</replaceable>…</command></term> |
27722f96 LN |
1554 | |
1555 | <listitem> | |
1556 | <para>Set one or more systemd manager environment variables, | |
1557 | as specified on the command line.</para> | |
1558 | </listitem> | |
1559 | </varlistentry> | |
1560 | <varlistentry> | |
1eecafb8 | 1561 | <term><command>unset-environment <replaceable>VARIABLE</replaceable>…</command></term> |
27722f96 LN |
1562 | |
1563 | <listitem> | |
1564 | <para>Unset one or more systemd manager environment | |
1565 | variables. If only a variable name is specified, it will be | |
1566 | removed regardless of its value. If a variable and a value | |
1567 | are specified, the variable is only removed if it has the | |
1568 | specified value.</para> | |
1569 | </listitem> | |
ac3efa8a LP |
1570 | </varlistentry> |
1571 | <varlistentry> | |
3fb90db2 | 1572 | <term> |
b975b0d5 | 1573 | <command>import-environment</command> |
1eecafb8 | 1574 | <optional><replaceable>VARIABLE…</replaceable></optional> |
b975b0d5 | 1575 | </term> |
ac3efa8a LP |
1576 | |
1577 | <listitem> | |
1578 | <para>Import all, one or more environment variables set on | |
1579 | the client into the systemd manager environment block. If | |
73e231ab JE |
1580 | no arguments are passed, the entire environment block is |
1581 | imported. Otherwise, a list of one or more environment | |
1582 | variable names should be passed, whose client-side values | |
ac3efa8a LP |
1583 | are then imported into the manager's environment |
1584 | block.</para> | |
1585 | </listitem> | |
27722f96 LN |
1586 | </varlistentry> |
1587 | </variablelist> | |
1588 | </refsect2> | |
1589 | ||
1590 | <refsect2> | |
1591 | <title>Manager Lifecycle Commands</title> | |
1592 | ||
1593 | <variablelist> | |
1594 | <varlistentry> | |
1595 | <term><command>daemon-reload</command></term> | |
1596 | ||
1597 | <listitem> | |
a8eaaee7 | 1598 | <para>Reload the systemd manager configuration. This will |
432d5965 ZJS |
1599 | rerun all generators (see |
1600 | <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>), | |
1601 | reload all unit files, and recreate the entire dependency | |
1602 | tree. While the daemon is being reloaded, all sockets | |
1603 | systemd listens on behalf of user configuration will stay | |
1604 | accessible.</para> | |
1605 | ||
1606 | <para>This command should not be confused with the | |
1607 | <command>reload</command> command.</para> | |
27722f96 LN |
1608 | </listitem> |
1609 | </varlistentry> | |
1610 | <varlistentry> | |
1611 | <term><command>daemon-reexec</command></term> | |
1612 | ||
1613 | <listitem> | |
1614 | <para>Reexecute the systemd manager. This will serialize the | |
1615 | manager state, reexecute the process and deserialize the | |
1616 | state again. This command is of little use except for | |
79640424 | 1617 | debugging and package upgrades. Sometimes, it might be |
27722f96 | 1618 | helpful as a heavy-weight <command>daemon-reload</command>. |
79640424 | 1619 | While the daemon is being reexecuted, all sockets systemd listening |
27722f96 LN |
1620 | on behalf of user configuration will stay accessible. |
1621 | </para> | |
1622 | </listitem> | |
1623 | </varlistentry> | |
1624 | </variablelist> | |
1625 | </refsect2> | |
1626 | ||
1627 | <refsect2> | |
1628 | <title>System Commands</title> | |
1629 | ||
1630 | <variablelist> | |
99813a19 LP |
1631 | <varlistentry> |
1632 | <term><command>is-system-running</command></term> | |
1633 | ||
1634 | <listitem> | |
2de51fdc | 1635 | <para>Checks whether the system is operational. This |
94f099d8 LP |
1636 | returns success (exit code 0) when the system is fully up |
1637 | and running, specifically not in startup, shutdown or | |
1638 | maintenance mode, and with no failed services. Failure is | |
1639 | returned otherwise (exit code non-zero). In addition, the | |
2de51fdc | 1640 | current state is printed in a short string to standard |
a8eaaee7 | 1641 | output, see the table below. Use <option>--quiet</option> to |
2de51fdc ZJS |
1642 | suppress this output.</para> |
1643 | ||
1644 | <table> | |
94f099d8 LP |
1645 | <title><command>is-system-running</command> output</title> |
1646 | <tgroup cols='3'> | |
1647 | <colspec colname='name'/> | |
1648 | <colspec colname='description'/> | |
1649 | <colspec colname='exit-code'/> | |
2de51fdc ZJS |
1650 | <thead> |
1651 | <row> | |
1652 | <entry>Name</entry> | |
1653 | <entry>Description</entry> | |
94f099d8 | 1654 | <entry>Exit Code</entry> |
2de51fdc ZJS |
1655 | </row> |
1656 | </thead> | |
1657 | <tbody> | |
1658 | <row> | |
1659 | <entry><varname>initializing</varname></entry> | |
1660 | <entry><para>Early bootup, before | |
1fdfa094 LP |
1661 | <filename>basic.target</filename> is reached |
1662 | or the <varname>maintenance</varname> state entered. | |
2de51fdc | 1663 | </para></entry> |
94f099d8 | 1664 | <entry>> 0</entry> |
2de51fdc ZJS |
1665 | </row> |
1666 | <row> | |
1667 | <entry><varname>starting</varname></entry> | |
1fdfa094 LP |
1668 | <entry><para>Late bootup, before the job queue |
1669 | becomes idle for the first time, or one of the | |
1670 | rescue targets are reached.</para></entry> | |
94f099d8 | 1671 | <entry>> 0</entry> |
2de51fdc ZJS |
1672 | </row> |
1673 | <row> | |
1674 | <entry><varname>running</varname></entry> | |
1675 | <entry><para>The system is fully | |
1676 | operational.</para></entry> | |
94f099d8 | 1677 | <entry>0</entry> |
2de51fdc ZJS |
1678 | </row> |
1679 | <row> | |
1680 | <entry><varname>degraded</varname></entry> | |
1681 | <entry><para>The system is operational but one or more | |
1682 | units failed.</para></entry> | |
94f099d8 | 1683 | <entry>> 0</entry> |
2de51fdc ZJS |
1684 | </row> |
1685 | <row> | |
1686 | <entry><varname>maintenance</varname></entry> | |
1fdfa094 | 1687 | <entry><para>The rescue or emergency target is |
2de51fdc | 1688 | active.</para></entry> |
94f099d8 | 1689 | <entry>> 0</entry> |
2de51fdc ZJS |
1690 | </row> |
1691 | <row> | |
1692 | <entry><varname>stopping</varname></entry> | |
1693 | <entry><para>The manager is shutting | |
1694 | down.</para></entry> | |
94f099d8 LP |
1695 | <entry>> 0</entry> |
1696 | </row> | |
1697 | <row> | |
1698 | <entry><varname>offline</varname></entry> | |
1699 | <entry><para>The manager is not | |
1700 | running. Specifically, this is the operational | |
1701 | state if an incompatible program is running as | |
1702 | system manager (PID 1).</para></entry> | |
1703 | <entry>> 0</entry> | |
1704 | </row> | |
1705 | <row> | |
1706 | <entry><varname>unknown</varname></entry> | |
1707 | <entry><para>The operational state could not be | |
1708 | determined, due to lack of resources or another | |
1709 | error cause.</para></entry> | |
1710 | <entry>> 0</entry> | |
2de51fdc ZJS |
1711 | </row> |
1712 | </tbody> | |
1713 | </tgroup> | |
1714 | </table> | |
99813a19 LP |
1715 | </listitem> |
1716 | </varlistentry> | |
1717 | ||
27722f96 LN |
1718 | <varlistentry> |
1719 | <term><command>default</command></term> | |
1720 | ||
1721 | <listitem> | |
6324a8a7 LP |
1722 | <para>Enter default mode. This is equivalent to <command>systemctl isolate default.target</command>. This |
1723 | operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para> | |
27722f96 LN |
1724 | </listitem> |
1725 | </varlistentry> | |
99813a19 | 1726 | |
27722f96 LN |
1727 | <varlistentry> |
1728 | <term><command>rescue</command></term> | |
1729 | ||
1730 | <listitem> | |
6324a8a7 LP |
1731 | <para>Enter rescue mode. This is equivalent to <command>systemctl isolate rescue.target</command>. This |
1732 | operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para> | |
27722f96 LN |
1733 | </listitem> |
1734 | </varlistentry> | |
1735 | <varlistentry> | |
1736 | <term><command>emergency</command></term> | |
1737 | ||
1738 | <listitem> | |
6324a8a7 LP |
1739 | <para>Enter emergency mode. This is equivalent to <command>systemctl isolate |
1740 | emergency.target</command>. This operation is blocking by default, use <option>--no-block</option> to | |
1741 | request asynchronous behavior.</para> | |
27722f96 LN |
1742 | </listitem> |
1743 | </varlistentry> | |
1744 | <varlistentry> | |
1745 | <term><command>halt</command></term> | |
1746 | ||
1747 | <listitem> | |
6324a8a7 LP |
1748 | <para>Shut down and halt the system. This is mostly equivalent to <command>systemctl start halt.target |
1749 | --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all users. This command is | |
1750 | asynchronous; it will return after the halt operation is enqueued, without waiting for it to complete. Note | |
1751 | that this operation will simply halt the OS kernel after shutting down, leaving the hardware powered | |
1752 | on. Use <command>systemctl poweroff</command> for powering off the system (see below).</para> | |
1753 | ||
1754 | <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all | |
1755 | processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the | |
1756 | system halt. If <option>--force</option> is specified twice, the operation is immediately executed without | |
1757 | terminating any processes or unmounting any file systems. This may result in data loss. Note that when | |
1758 | <option>--force</option> is specified twice the halt operation is executed by <command>systemctl</command> | |
1759 | itself, and the system manager is not contacted. This means the command should succeed even when the system | |
1760 | manager has crashed.</para> | |
27722f96 LN |
1761 | </listitem> |
1762 | </varlistentry> | |
1763 | <varlistentry> | |
1764 | <term><command>poweroff</command></term> | |
1765 | ||
1766 | <listitem> | |
6324a8a7 LP |
1767 | <para>Shut down and power-off the system. This is mostly equivalent to <command>systemctl start |
1768 | poweroff.target --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all | |
1769 | users. This command is asynchronous; it will return after the power-off operation is enqueued, without | |
1770 | waiting for it to complete.</para> | |
1771 | ||
1772 | <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all | |
1773 | processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the | |
1774 | powering off. If <option>--force</option> is specified twice, the operation is immediately executed without | |
1775 | terminating any processes or unmounting any file systems. This may result in data loss. Note that when | |
924e44b4 LP |
1776 | <option>--force</option> is specified twice the power-off operation is executed by |
1777 | <command>systemctl</command> itself, and the system manager is not contacted. This means the command should | |
6324a8a7 | 1778 | succeed even when the system manager has crashed.</para> |
27722f96 LN |
1779 | </listitem> |
1780 | </varlistentry> | |
1781 | <varlistentry> | |
37185ec8 | 1782 | <term><command>reboot <optional><replaceable>arg</replaceable></optional></command></term> |
27722f96 LN |
1783 | |
1784 | <listitem> | |
6324a8a7 LP |
1785 | <para>Shut down and reboot the system. This is mostly equivalent to <command>systemctl start reboot.target |
1786 | --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all users. This | |
1787 | command is asynchronous; it will return after the reboot operation is enqueued, without waiting for it to | |
1788 | complete.</para> | |
1789 | ||
1790 | <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all | |
1791 | processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the | |
1792 | reboot. If <option>--force</option> is specified twice, the operation is immediately executed without | |
1793 | terminating any processes or unmounting any file systems. This may result in data loss. Note that when | |
924e44b4 LP |
1794 | <option>--force</option> is specified twice the reboot operation is executed by |
1795 | <command>systemctl</command> itself, and the system manager is not contacted. This means the command should | |
6324a8a7 LP |
1796 | succeed even when the system manager has crashed.</para> |
1797 | ||
1798 | <para>If the optional argument <replaceable>arg</replaceable> is given, it will be passed as the optional | |
1799 | argument to the <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry> | |
1800 | system call. The value is architecture and firmware specific. As an example, <literal>recovery</literal> | |
1801 | might be used to trigger system recovery, and <literal>fota</literal> might be used to trigger a | |
37185ec8 | 1802 | <quote>firmware over the air</quote> update.</para> |
27722f96 LN |
1803 | </listitem> |
1804 | </varlistentry> | |
b619ec8f | 1805 | |
27722f96 LN |
1806 | <varlistentry> |
1807 | <term><command>kexec</command></term> | |
1808 | ||
1809 | <listitem> | |
6324a8a7 LP |
1810 | <para>Shut down and reboot the system via <command>kexec</command>. This is equivalent to |
1811 | <command>systemctl start kexec.target --job-mode=replace-irreversibly --no-block</command>. This command is | |
1812 | asynchronous; it will return after the reboot operation is enqueued, without waiting for it to | |
1813 | complete.</para> | |
1814 | ||
1815 | <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all | |
1816 | processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the | |
1817 | reboot.</para> | |
27722f96 LN |
1818 | </listitem> |
1819 | </varlistentry> | |
b619ec8f | 1820 | |
27722f96 | 1821 | <varlistentry> |
287419c1 | 1822 | <term><command>exit <optional><replaceable>EXIT_CODE</replaceable></optional></command></term> |
27722f96 LN |
1823 | |
1824 | <listitem> | |
6324a8a7 LP |
1825 | <para>Ask the service manager to quit. This is only supported for user service managers (i.e. in |
1826 | conjunction with the <option>--user</option> option) or in containers and is equivalent to | |
1827 | <command>poweroff</command> otherwise. This command is asynchronous; it will return after the exit | |
1828 | operation is enqueued, without waiting for it to complete.</para> | |
1829 | ||
dcfaecc7 | 1830 | <para>The service manager will exit with the specified exit code, if |
6324a8a7 | 1831 | <replaceable>EXIT_CODE</replaceable> is passed.</para> |
27722f96 | 1832 | </listitem> |
b619ec8f | 1833 | </varlistentry> |
27722f96 | 1834 | |
b619ec8f LP |
1835 | <varlistentry> |
1836 | <term><command>switch-root <replaceable>ROOT</replaceable> <optional><replaceable>INIT</replaceable></optional></command></term> | |
1837 | ||
1838 | <listitem> | |
fb1bad9d LP |
1839 | <para>Switches to a different root directory and executes a new system manager process below it. This is |
1840 | intended for usage in initial RAM disks ("initrd"), and will transition from the initrd's system manager | |
1841 | process (a.k.a. "init" process) to the main system manager process which is loaded from the actual host | |
1842 | volume. This call takes two arguments: the directory that is to become the new root directory, and the path | |
1843 | to the new system manager binary below it to execute as PID 1. If the latter is omitted or the empty | |
1844 | string, a systemd binary will automatically be searched for and used as init. If the system manager path is | |
1845 | omitted, equal to the empty string or identical to the path to the systemd binary, the state of the | |
1846 | initrd's system manager process is passed to the main system manager, which allows later introspection of | |
1847 | the state of the services involved in the initrd boot phase.</para> | |
b619ec8f | 1848 | </listitem> |
27722f96 | 1849 | </varlistentry> |
b619ec8f | 1850 | |
27722f96 LN |
1851 | <varlistentry> |
1852 | <term><command>suspend</command></term> | |
1853 | ||
1854 | <listitem> | |
6324a8a7 LP |
1855 | <para>Suspend the system. This will trigger activation of the special target unit |
1856 | <filename>suspend.target</filename>. This command is asynchronous, and will return after the suspend | |
1857 | operation is successfully enqueued. It will not wait for the suspend/resume cycle to complete.</para> | |
27722f96 LN |
1858 | </listitem> |
1859 | </varlistentry> | |
b619ec8f | 1860 | |
27722f96 LN |
1861 | <varlistentry> |
1862 | <term><command>hibernate</command></term> | |
1863 | ||
1864 | <listitem> | |
6324a8a7 LP |
1865 | <para>Hibernate the system. This will trigger activation of the special target unit |
1866 | <filename>hibernate.target</filename>. This command is asynchronous, and will return after the hibernation | |
1867 | operation is successfully enqueued. It will not wait for the hibernate/thaw cycle to complete.</para> | |
27722f96 LN |
1868 | </listitem> |
1869 | </varlistentry> | |
b619ec8f | 1870 | |
27722f96 LN |
1871 | <varlistentry> |
1872 | <term><command>hybrid-sleep</command></term> | |
1873 | ||
1874 | <listitem> | |
6324a8a7 LP |
1875 | <para>Hibernate and suspend the system. This will trigger activation of the special target unit |
1876 | <filename>hybrid-sleep.target</filename>. This command is asynchronous, and will return after the hybrid | |
1877 | sleep operation is successfully enqueued. It will not wait for the sleep/wake-up cycle to complete.</para> | |
27722f96 LN |
1878 | </listitem> |
1879 | </varlistentry> | |
27722f96 LN |
1880 | </variablelist> |
1881 | </refsect2> | |
4a6022f0 | 1882 | |
a7c0e5d7 LP |
1883 | <refsect2> |
1884 | <title>Parameter Syntax</title> | |
1885 | ||
da5e955f | 1886 | <para>Unit commands listed above take either a single unit name (designated as <replaceable>UNIT</replaceable>), |
1eecafb8 | 1887 | or multiple unit specifications (designated as <replaceable>PATTERN</replaceable>…). In the first case, the |
da25e029 ZJS |
1888 | unit name with or without a suffix must be given. If the suffix is not specified (unit name is "abbreviated"), |
1889 | systemctl will append a suitable suffix, <literal>.service</literal> by default, and a type-specific suffix in | |
1890 | case of commands which operate only on specific unit types. For example, | |
e3e0314b ZJS |
1891 | <programlisting># systemctl start sshd</programlisting> and |
1892 | <programlisting># systemctl start sshd.service</programlisting> | |
1893 | are equivalent, as are | |
507e28d8 | 1894 | <programlisting># systemctl isolate default</programlisting> |
e3e0314b | 1895 | and |
507e28d8 | 1896 | <programlisting># systemctl isolate default.target</programlisting> |
da25e029 ZJS |
1897 | Note that (absolute) paths to device nodes are automatically converted to device unit names, and other (absolute) |
1898 | paths to mount unit names. | |
e3e0314b ZJS |
1899 | <programlisting># systemctl status /dev/sda |
1900 | # systemctl status /home</programlisting> | |
1901 | are equivalent to: | |
1902 | <programlisting># systemctl status dev-sda.device | |
1903 | # systemctl status home.mount</programlisting> | |
2cdbbc9a | 1904 | In the second case, shell-style globs will be matched against the primary names of all units currently in memory; |
1f00eded LP |
1905 | literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit |
1906 | names always refer to exactly one unit, but globs may match zero units and this is not considered an | |
1907 | error.</para> | |
e3e0314b ZJS |
1908 | |
1909 | <para>Glob patterns use | |
decde8cd | 1910 | <citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>, |
e3e0314b ZJS |
1911 | so normal shell-style globbing rules are used, and |
1912 | <literal>*</literal>, <literal>?</literal>, | |
1913 | <literal>[]</literal> may be used. See | |
decde8cd | 1914 | <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
1f00eded | 1915 | for more details. The patterns are matched against the primary names of |
2cdbbc9a | 1916 | units currently in memory, and patterns which do not match anything |
e3e0314b ZJS |
1917 | are silently skipped. For example: |
1918 | <programlisting># systemctl stop sshd@*.service</programlisting> | |
1f00eded | 1919 | will stop all <filename>sshd@.service</filename> instances. Note that alias names of units, and units that aren't |
2cdbbc9a | 1920 | in memory are not considered for glob expansion. |
e3e0314b ZJS |
1921 | </para> |
1922 | ||
da5e955f | 1923 | <para>For unit file commands, the specified <replaceable>UNIT</replaceable> should be the name of the unit file |
1534e170 | 1924 | (possibly abbreviated, see above), or the absolute path to the unit file: |
e3e0314b ZJS |
1925 | <programlisting># systemctl enable foo.service</programlisting> |
1926 | or | |
1927 | <programlisting># systemctl link /path/to/foo.service</programlisting> | |
1928 | </para> | |
a7c0e5d7 LP |
1929 | </refsect2> |
1930 | ||
4a6022f0 ZJS |
1931 | </refsect1> |
1932 | ||
1933 | <refsect1> | |
1934 | <title>Exit status</title> | |
1935 | ||
7b870f60 | 1936 | <para>On success, 0 is returned, a non-zero failure |
4a6022f0 ZJS |
1937 | code otherwise.</para> |
1938 | </refsect1> | |
1939 | ||
7d4fb3b1 RC |
1940 | <refsect1> |
1941 | <title>Environment</title> | |
1942 | ||
1943 | <variablelist class='environment-variables'> | |
1944 | <varlistentry> | |
1945 | <term><varname>$SYSTEMD_EDITOR</varname></term> | |
1946 | ||
1947 | <listitem><para>Editor to use when editing units; overrides | |
1948 | <varname>$EDITOR</varname> and <varname>$VISUAL</varname>. If neither | |
1949 | <varname>$SYSTEMD_EDITOR</varname> nor <varname>$EDITOR</varname> nor | |
1950 | <varname>$VISUAL</varname> are present or if it is set to an empty | |
1951 | string or if their execution failed, systemctl will try to execute well | |
1952 | known editors in this order: | |
9391a1c3 | 1953 | <citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
3ba3a79d ZJS |
1954 | <citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
1955 | <citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1956 | <citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | |
7d4fb3b1 RC |
1957 | </para></listitem> |
1958 | </varlistentry> | |
1959 | </variablelist> | |
1960 | <xi:include href="less-variables.xml" xpointer="pager"/> | |
1961 | <xi:include href="less-variables.xml" xpointer="less"/> | |
6e16066e | 1962 | <xi:include href="less-variables.xml" xpointer="lesscharset"/> |
7d4fb3b1 | 1963 | </refsect1> |
4a6022f0 ZJS |
1964 | |
1965 | <refsect1> | |
1966 | <title>See Also</title> | |
1967 | <para> | |
1968 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
4a6022f0 ZJS |
1969 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
1970 | <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
a03fe1a5 | 1971 | <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
4a6022f0 | 1972 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
ee41f602 | 1973 | <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
4a6022f0 | 1974 | <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
5aded369 | 1975 | <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
7d4fb3b1 | 1976 | <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
432d5965 | 1977 | <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
decde8cd | 1978 | <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
4a6022f0 ZJS |
1979 | </para> |
1980 | </refsect1> | |
7874bcd6 LP |
1981 | |
1982 | </refentry> |