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