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