]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemctl.xml
Merge pull request #1192 from poettering/sd-bus-container
[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>--message=</option></term>
478
479 <listitem>
480 <para>When used with <command>halt</command>,
481 <command>poweroff</command>, <command>reboot</command> or
482 <command>kexec</command>, set a short message explaining the reason
483 for the operation. The message will be logged together with the
484 default shutdown message.</para>
485 </listitem>
486 </varlistentry>
487
488 <varlistentry>
489 <term><option>--now</option></term>
490
491 <listitem>
492 <para>When used with <command>enable</command>, the units
493 will also be started. When used with <command>disable</command> or
494 <command>mask</command>, the units will also be stopped. The start
495 or stop operation is only carried out when the respective enable or
496 disable operation has been successful.</para>
497 </listitem>
498 </varlistentry>
499
500 <varlistentry>
501 <term><option>--root=</option></term>
502
503 <listitem>
504 <para>When used with
505 <command>enable</command>/<command>disable</command>/<command>is-enabled</command>
506 (and related commands), use alternative root path when
507 looking for unit files.</para>
508 </listitem>
509
510 </varlistentry>
511
512 <varlistentry>
513 <term><option>--runtime</option></term>
514
515 <listitem>
516 <para>When used with <command>enable</command>,
517 <command>disable</command>, <command>edit</command>,
518 (and related commands), make changes only temporarily, so
519 that they are lost on the next reboot. This will have the
520 effect that changes are not made in subdirectories of
521 <filename>/etc</filename> but in <filename>/run</filename>,
522 with identical immediate effects, however, since the latter
523 is lost on reboot, the changes are lost too.</para>
524
525 <para>Similarly, when used with
526 <command>set-property</command>, make changes only
527 temporarily, so that they are lost on the next
528 reboot.</para>
529 </listitem>
530 </varlistentry>
531
532 <varlistentry>
533 <term><option>--preset-mode=</option></term>
534
535 <listitem>
536 <para>Takes one of <literal>full</literal> (the default),
537 <literal>enable-only</literal>,
538 <literal>disable-only</literal>. When used with the
539 <command>preset</command> or <command>preset-all</command>
540 commands, controls whether units shall be disabled and
541 enabled according to the preset rules, or only enabled, or
542 only disabled.</para>
543 </listitem>
544 </varlistentry>
545
546 <varlistentry>
547 <term><option>-n</option></term>
548 <term><option>--lines=</option></term>
549
550 <listitem>
551 <para>When used with <command>status</command>, controls the
552 number of journal lines to show, counting from the most
553 recent ones. Takes a positive integer argument. Defaults to
554 10.</para>
555 </listitem>
556 </varlistentry>
557
558 <varlistentry>
559 <term><option>-o</option></term>
560 <term><option>--output=</option></term>
561
562 <listitem>
563 <para>When used with <command>status</command>, controls the
564 formatting of the journal entries that are shown. For the
565 available choices, see
566 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
567 Defaults to <literal>short</literal>.</para>
568 </listitem>
569 </varlistentry>
570
571 <varlistentry>
572 <term><option>--firmware-setup</option></term>
573
574 <listitem>
575 <para>When used with the <command>reboot</command> command,
576 indicate to the system's firmware to boot into setup
577 mode. Note that this is currently only supported on some EFI
578 systems and only if the system was booted in EFI
579 mode.</para>
580 </listitem>
581 </varlistentry>
582
583 <varlistentry>
584 <term><option>--plain</option></term>
585
586 <listitem>
587 <para>When used with <command>list-dependencies</command>,
588 the output is printed as a list instead of a tree.</para>
589 </listitem>
590 </varlistentry>
591
592 <xi:include href="user-system-options.xml" xpointer="host" />
593 <xi:include href="user-system-options.xml" xpointer="machine" />
594
595 <xi:include href="standard-options.xml" xpointer="no-pager" />
596 <xi:include href="standard-options.xml" xpointer="no-legend" />
597 <xi:include href="standard-options.xml" xpointer="help" />
598 <xi:include href="standard-options.xml" xpointer="version" />
599 </variablelist>
600 </refsect1>
601
602 <refsect1>
603 <title>Commands</title>
604
605 <para>The following commands are understood:</para>
606
607 <refsect2>
608 <title>Unit Commands</title>
609
610 <variablelist>
611 <varlistentry>
612 <term><command>list-units <optional><replaceable>PATTERN</replaceable>...</optional></command></term>
613
614 <listitem>
615 <para>List known units (subject to limitations specified
616 with <option>-t</option>). If one or more
617 <replaceable>PATTERN</replaceable>s are specified, only
618 units matching one of them are shown.</para>
619
620 <para>This is the default command.</para>
621 </listitem>
622 </varlistentry>
623
624 <varlistentry>
625 <term><command>list-sockets <optional><replaceable>PATTERN</replaceable>...</optional></command></term>
626
627 <listitem>
628 <para>List socket units ordered by listening address.
629 If one or more <replaceable>PATTERN</replaceable>s are
630 specified, only socket units matching one of them are
631 shown. Produces output similar to
632 <programlisting>
633 LISTEN UNIT ACTIVATES
634 /dev/initctl systemd-initctl.socket systemd-initctl.service
635 ...
636 [::]:22 sshd.socket sshd.service
637 kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
638
639 5 sockets listed.</programlisting>
640 Note: because the addresses might contains spaces, this output
641 is not suitable for programmatic consumption.
642 </para>
643
644 <para>See also the options <option>--show-types</option>,
645 <option>--all</option>, and <option>--state=</option>.</para>
646 </listitem>
647 </varlistentry>
648
649 <varlistentry>
650 <term><command>list-timers <optional><replaceable>PATTERN</replaceable>...</optional></command></term>
651
652 <listitem>
653 <para>List timer units ordered by the time they elapse
654 next. If one or more <replaceable>PATTERN</replaceable>s
655 are specified, only units matching one of them are shown.
656 </para>
657
658 <para>See also the options <option>--all</option> and
659 <option>--state=</option>.</para>
660 </listitem>
661 </varlistentry>
662
663 <varlistentry>
664 <term><command>start <replaceable>PATTERN</replaceable>...</command></term>
665
666 <listitem>
667 <para>Start (activate) one or more units specified on the
668 command line.</para>
669
670 <para>Note that glob patterns operate on a list of currently
671 loaded units. Units which are not active and are not in a
672 failed state usually are not loaded, and would not be
673 matched by any pattern. In addition, in case of
674 instantiated units, systemd is often unaware of the
675 instance name until the instance has been started. Therefore,
676 using glob patterns with <command>start</command>
677 has limited usefulness.</para>
678 </listitem>
679 </varlistentry>
680 <varlistentry>
681 <term><command>stop <replaceable>PATTERN</replaceable>...</command></term>
682
683 <listitem>
684 <para>Stop (deactivate) one or more units specified on the
685 command line.</para>
686 </listitem>
687 </varlistentry>
688 <varlistentry>
689 <term><command>reload <replaceable>PATTERN</replaceable>...</command></term>
690
691 <listitem>
692 <para>Asks all units listed on the command line to reload
693 their configuration. Note that this will reload the
694 service-specific configuration, not the unit configuration
695 file of systemd. If you want systemd to reload the
696 configuration file of a unit, use the
697 <command>daemon-reload</command> command. In other words:
698 for the example case of Apache, this will reload Apache's
699 <filename>httpd.conf</filename> in the web server, not the
700 <filename>apache.service</filename> systemd unit
701 file.</para>
702
703 <para>This command should not be confused with the
704 <command>daemon-reload</command> command.</para>
705 </listitem>
706
707 </varlistentry>
708 <varlistentry>
709 <term><command>restart <replaceable>PATTERN</replaceable>...</command></term>
710
711 <listitem>
712 <para>Restart one or more units specified on the command
713 line. If the units are not running yet, they will be
714 started.</para>
715 </listitem>
716 </varlistentry>
717 <varlistentry>
718 <term><command>try-restart <replaceable>PATTERN</replaceable>...</command></term>
719
720 <listitem>
721 <para>Restart one or more units specified on the command
722 line if the units are running. This does nothing if units are not
723 running. Note that, for compatibility with Red Hat init
724 scripts, <command>condrestart</command> is equivalent to this
725 command.</para>
726 </listitem>
727 </varlistentry>
728 <varlistentry>
729 <term><command>reload-or-restart <replaceable>PATTERN</replaceable>...</command></term>
730
731 <listitem>
732 <para>Reload one or more units if they support it. If not,
733 restart them instead. If the units are not running yet, they
734 will be started.</para>
735 </listitem>
736 </varlistentry>
737 <varlistentry>
738 <term><command>reload-or-try-restart <replaceable>PATTERN</replaceable>...</command></term>
739
740 <listitem>
741 <para>Reload one or more units if they support it. If not,
742 restart them instead. This does nothing if the units are not
743 running. Note that, for compatibility with SysV init scripts,
744 <command>force-reload</command> is equivalent to this
745 command.</para>
746 </listitem>
747 </varlistentry>
748 <varlistentry>
749 <term><command>isolate <replaceable>NAME</replaceable></command></term>
750
751 <listitem>
752 <para>Start the unit specified on the command line and its
753 dependencies and stop all others. If a unit name with no
754 extension is given, an extension of
755 <literal>.target</literal> will be assumed.</para>
756
757 <para>This is similar to changing the runlevel in a
758 traditional init system. The <command>isolate</command>
759 command will immediately stop processes that are not enabled
760 in the new unit, possibly including the graphical
761 environment or terminal you are currently using.</para>
762
763 <para>Note that this is allowed only on units where
764 <option>AllowIsolate=</option> is enabled. See
765 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
766 for details.</para>
767 </listitem>
768 </varlistentry>
769 <varlistentry>
770 <term><command>kill <replaceable>PATTERN</replaceable>...</command></term>
771
772 <listitem>
773 <para>Send a signal to one or more processes of the
774 unit. Use <option>--kill-who=</option> to select which
775 process to kill. Use <option>--signal=</option> to select
776 the signal to send.</para>
777 </listitem>
778 </varlistentry>
779 <varlistentry>
780 <term><command>is-active <replaceable>PATTERN</replaceable>...</command></term>
781
782 <listitem>
783 <para>Check whether any of the specified units are active
784 (i.e. running). Returns an exit code
785 <constant>0</constant> if at least one is active, or
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>is-failed <replaceable>PATTERN</replaceable>...</command></term>
793
794 <listitem>
795 <para>Check whether any of the specified units are in a
796 "failed" state. Returns an exit code
797 <constant>0</constant> if at least one has failed,
798 non-zero otherwise. Unless <option>--quiet</option> is
799 specified, this will also print the current unit state to
800 standard output.</para>
801 </listitem>
802 </varlistentry>
803 <varlistentry>
804 <term><command>status</command> <optional><replaceable>PATTERN</replaceable>...|<replaceable>PID</replaceable>...]</optional></term>
805
806 <listitem>
807 <para>Show terse runtime status information about one or
808 more units, followed by most recent log data from the
809 journal. If no units are specified, show system status. If
810 combined with <option>--all</option>, also show the status of
811 all units (subject to limitations specified with
812 <option>-t</option>). If a PID is passed, show information
813 about the unit the process belongs to.</para>
814
815 <para>This function is intended to generate human-readable
816 output. If you are looking for computer-parsable output,
817 use <command>show</command> instead. By default this
818 function only shows 10 lines of output and ellipsizes
819 lines to fit in the terminal window. This can be changes
820 with <option>--lines</option> and <option>--full</option>,
821 see above. In addition, <command>journalctl
822 --unit=<replaceable>NAME</replaceable></command> or
823 <command>journalctl
824 --user-unit=<replaceable>NAME</replaceable></command> use
825 a similar filter for messages and might be more
826 convenient.
827 </para>
828 </listitem>
829 </varlistentry>
830 <varlistentry>
831 <term><command>show</command> <optional><replaceable>PATTERN</replaceable>...|<replaceable>JOB</replaceable>...</optional></term>
832
833 <listitem>
834 <para>Show properties of one or more units, jobs, or the
835 manager itself. If no argument is specified, properties of
836 the manager will be shown. If a unit name is specified,
837 properties of the unit is shown, and if a job id is
838 specified, properties of the job is shown. By default, empty
839 properties are suppressed. Use <option>--all</option> to
840 show those too. To select specific properties to show, use
841 <option>--property=</option>. This command is intended to be
842 used whenever computer-parsable output is required. Use
843 <command>status</command> if you are looking for formatted
844 human-readable output.</para>
845 </listitem>
846 </varlistentry>
847 <varlistentry>
848 <term><command>cat <replaceable>PATTERN</replaceable>...</command></term>
849
850 <listitem>
851 <para>Show backing files of one or more units. Prints the
852 "fragment" and "drop-ins" (source files) of units. Each
853 file is preceded by a comment which includes the file
854 name.</para>
855 </listitem>
856 </varlistentry>
857 <varlistentry>
858 <term><command>set-property <replaceable>NAME</replaceable> <replaceable>ASSIGNMENT</replaceable>...</command></term>
859
860 <listitem>
861 <para>Set the specified unit properties at runtime where
862 this is supported. This allows changing configuration
863 parameter properties such as resource control settings at
864 runtime. Not all properties may be changed at runtime, but
865 many resource control settings (primarily those in
866 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>)
867 may. The changes are applied instantly, and stored on disk
868 for future boots, unless <option>--runtime</option> is
869 passed, in which case the settings only apply until the
870 next reboot. The syntax of the property assignment follows
871 closely the syntax of assignments in unit files.</para>
872
873 <para>Example: <command>systemctl set-property foobar.service CPUShares=777</command></para>
874
875 <para>Note that this command allows changing multiple
876 properties at the same time, which is preferable over
877 setting them individually. Like unit file configuration
878 settings, assigning the empty list to list parameters will
879 reset the list.</para>
880 </listitem>
881 </varlistentry>
882
883 <varlistentry>
884 <term><command>help <replaceable>PATTERN</replaceable>...|<replaceable>PID</replaceable>...</command></term>
885
886 <listitem>
887 <para>Show manual pages for one or more units, if
888 available. If a PID is given, the manual pages for the unit
889 the process belongs to are shown.</para>
890 </listitem>
891 </varlistentry>
892
893 <varlistentry>
894 <term><command>reset-failed [<replaceable>PATTERN</replaceable>...]</command></term>
895
896 <listitem>
897 <para>Reset the <literal>failed</literal> state of the
898 specified units, or if no unit name is passed, reset the state of all
899 units. When a unit fails in some way (i.e. process exiting
900 with non-zero error code, terminating abnormally or timing
901 out), it will automatically enter the
902 <literal>failed</literal> state and its exit code and status
903 is recorded for introspection by the administrator until the
904 service is restarted or reset with this command.</para>
905 </listitem>
906 </varlistentry>
907
908 <varlistentry>
909 <term>
910 <command>list-dependencies</command>
911 <optional><replaceable>NAME</replaceable></optional>
912 </term>
913
914 <listitem>
915 <para>Shows units required and wanted by the specified
916 unit. This recursively lists units following the
917 <varname>Requires=</varname>,
918 <varname>RequiresOverridable=</varname>,
919 <varname>Requisite=</varname>,
920 <varname>RequisiteOverridable=</varname>,
921 <varname>ConsistsOf=</varname>,
922 <varname>Wants=</varname>, <varname>BindsTo=</varname>
923 dependencies. If no unit is specified,
924 <filename>default.target</filename> is implied.</para>
925
926 <para>By default, only target units are recursively
927 expanded. When <option>--all</option> is passed, all other
928 units are recursively expanded as well.</para>
929
930 <para>Options <option>--reverse</option>,
931 <option>--after</option>, <option>--before</option>
932 may be used to change what types of dependencies
933 are shown.</para>
934 </listitem>
935 </varlistentry>
936 </variablelist>
937 </refsect2>
938
939 <refsect2>
940 <title>Unit File Commands</title>
941
942 <variablelist>
943 <varlistentry>
944 <term><command>list-unit-files <optional><replaceable>PATTERN...</replaceable></optional></command></term>
945
946 <listitem>
947 <para>List installed unit files. If one or more
948 <replaceable>PATTERN</replaceable>s are specified, only
949 units whose filename (just the last component of the path)
950 matches one of them are shown.</para>
951 </listitem>
952 </varlistentry>
953
954 <varlistentry>
955 <term><command>enable <replaceable>NAME</replaceable>...</command></term>
956
957 <listitem>
958 <para>Enable one or more unit files or unit file instances,
959 as specified on the command line. This will create a number
960 of symlinks as encoded in the <literal>[Install]</literal>
961 sections of the unit files. After the symlinks have been
962 created, the systemd configuration is reloaded (in a way that
963 is equivalent to <command>daemon-reload</command>) to ensure
964 the changes are taken into account immediately. Note that
965 this does <emphasis>not</emphasis> have the effect of also
966 starting any of the units being enabled. If this
967 is desired, either <option>--now</option> should be used
968 together with this command, or an additional <command>start</command>
969 command must be invoked for the unit. Also note that in case of
970 instance enablement, symlinks named the same as instances
971 are created in the install location, however they all point to the
972 same template unit file.</para>
973
974 <para>This command will print the actions executed. This
975 output may be suppressed by passing <option>--quiet</option>.
976 </para>
977
978 <para>Note that this operation creates only the suggested
979 symlinks for the units. While this command is the
980 recommended way to manipulate the unit configuration
981 directory, the administrator is free to make additional
982 changes manually by placing or removing symlinks in the
983 directory. This is particularly useful to create
984 configurations that deviate from the suggested default
985 installation. In this case, the administrator must make sure
986 to invoke <command>daemon-reload</command> manually as
987 necessary to ensure the changes are taken into account.
988 </para>
989
990 <para>Enabling units should not be confused with starting
991 (activating) units, as done by the <command>start</command>
992 command. Enabling and starting units is orthogonal: units
993 may be enabled without being started and started without
994 being enabled. Enabling simply hooks the unit into various
995 suggested places (for example, so that the unit is
996 automatically started on boot or when a particular kind of
997 hardware is plugged in). Starting actually spawns the daemon
998 process (in case of service units), or binds the socket (in
999 case of socket units), and so on.</para>
1000
1001 <para>Depending on whether <option>--system</option>,
1002 <option>--user</option>, <option>--runtime</option>,
1003 or <option>--global</option> is specified, this enables the unit
1004 for the system, for the calling user only, for only this boot of
1005 the system, or for all future logins of all users, or only this
1006 boot. Note that in the last case, no systemd daemon
1007 configuration is reloaded.</para>
1008
1009 <para>Using <command>enable</command> on masked units
1010 results in an error.</para>
1011 </listitem>
1012 </varlistentry>
1013
1014 <varlistentry>
1015 <term><command>disable <replaceable>NAME</replaceable>...</command></term>
1016
1017 <listitem>
1018 <para>Disables one or more units. This removes all symlinks
1019 to the specified unit files from the unit configuration
1020 directory, and hence undoes the changes made by
1021 <command>enable</command>. Note however that this removes
1022 all symlinks to the unit files (i.e. including manual
1023 additions), not just those actually created by
1024 <command>enable</command>. This call implicitly reloads the
1025 systemd daemon configuration after completing the disabling
1026 of the units. Note that this command does not implicitly
1027 stop the units that are being disabled. If this is desired, either
1028 <option>--now</option> should be used together with this command, or
1029 an additional <command>stop</command> command should be executed
1030 afterwards.</para>
1031
1032 <para>This command will print the actions executed. This
1033 output may be suppressed by passing <option>--quiet</option>.
1034 </para>
1035
1036 <para>This command honors <option>--system</option>,
1037 <option>--user</option>, <option>--runtime</option> and
1038 <option>--global</option> in a similar way as
1039 <command>enable</command>.</para>
1040 </listitem>
1041 </varlistentry>
1042
1043 <varlistentry>
1044 <term><command>reenable <replaceable>NAME</replaceable>...</command></term>
1045
1046 <listitem>
1047 <para>Reenable one or more unit files, as specified on the
1048 command line. This is a combination of
1049 <command>disable</command> and <command>enable</command> and
1050 is useful to reset the symlinks a unit is enabled with to
1051 the defaults configured in the <literal>[Install]</literal>
1052 section of the unit file.</para>
1053 </listitem>
1054 </varlistentry>
1055
1056 <varlistentry>
1057 <term><command>preset <replaceable>NAME</replaceable>...</command></term>
1058
1059 <listitem>
1060 <para>Reset one or more unit files, as specified on the
1061 command line, to the defaults configured in the preset
1062 policy files. This has the same effect as
1063 <command>disable</command> or <command>enable</command>,
1064 depending how the unit is listed in the preset files.</para>
1065
1066 <para>Use <option>--preset-mode=</option> to control
1067 whether units shall be enabled and disabled, or only
1068 enabled, or only disabled.</para>
1069
1070 <para>For more information on the preset policy format,
1071 see
1072 <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1073 For more information on the concept of presets, please
1074 consult the <ulink
1075 url="http://freedesktop.org/wiki/Software/systemd/Preset">Preset</ulink>
1076 document.</para>
1077 </listitem>
1078 </varlistentry>
1079
1080 <varlistentry>
1081 <term><command>preset-all</command></term>
1082
1083 <listitem>
1084 <para>Resets all installed unit files to the defaults
1085 configured in the preset policy file (see above).</para>
1086
1087 <para>Use <option>--preset-mode=</option> to control
1088 whether units shall be enabled and disabled, or only
1089 enabled, or only disabled.</para>
1090 </listitem>
1091 </varlistentry>
1092
1093 <varlistentry>
1094 <term><command>is-enabled <replaceable>NAME</replaceable>...</command></term>
1095
1096 <listitem>
1097 <para>Checks whether any of the specified unit files are
1098 enabled (as with <command>enable</command>). Returns an
1099 exit code of 0 if at least one is enabled, non-zero
1100 otherwise. Prints the current enable status (see table).
1101 To suppress this output, use <option>--quiet</option>.
1102 </para>
1103
1104 <table>
1105 <title>
1106 <command>is-enabled</command> output
1107 </title>
1108
1109 <tgroup cols='3'>
1110 <thead>
1111 <row>
1112 <entry>Printed string</entry>
1113 <entry>Meaning</entry>
1114 <entry>Return value</entry>
1115 </row>
1116 </thead>
1117 <tbody>
1118 <row>
1119 <entry><literal>enabled</literal></entry>
1120 <entry morerows='1'>Enabled through a symlink in <filename>.wants</filename> directory (permanently or just in <filename>/run</filename>).</entry>
1121 <entry morerows='1'>0</entry>
1122 </row>
1123 <row>
1124 <entry><literal>enabled-runtime</literal></entry>
1125 </row>
1126 <row>
1127 <entry><literal>linked</literal></entry>
1128 <entry morerows='1'>Made available through a symlink to the unit file (permanently or just in <filename>/run</filename>).</entry>
1129 <entry morerows='1'>1</entry>
1130 </row>
1131 <row>
1132 <entry><literal>linked-runtime</literal></entry>
1133 </row>
1134 <row>
1135 <entry><literal>masked</literal></entry>
1136 <entry morerows='1'>Disabled entirely (permanently or just in <filename>/run</filename>).</entry>
1137 <entry morerows='1'>1</entry>
1138 </row>
1139 <row>
1140 <entry><literal>masked-runtime</literal></entry>
1141 </row>
1142 <row>
1143 <entry><literal>static</literal></entry>
1144 <entry>Unit file is not enabled, and has no provisions for enabling in the <literal>[Install]</literal> section.</entry>
1145 <entry>0</entry>
1146 </row>
1147 <row>
1148 <entry><literal>indirect</literal></entry>
1149 <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>
1150 <entry>0</entry>
1151 </row>
1152 <row>
1153 <entry><literal>disabled</literal></entry>
1154 <entry>Unit file is not enabled.</entry>
1155 <entry>1</entry>
1156 </row>
1157 </tbody>
1158 </tgroup>
1159 </table>
1160
1161 </listitem>
1162 </varlistentry>
1163
1164 <varlistentry>
1165 <term><command>mask <replaceable>NAME</replaceable>...</command></term>
1166
1167 <listitem>
1168 <para>Mask one or more unit files, as specified on the
1169 command line. This will link these units to
1170 <filename>/dev/null</filename>, making it impossible to
1171 start them. This is a stronger version of
1172 <command>disable</command>, since it prohibits all kinds of
1173 activation of the unit, including enablement and manual
1174 activation. Use this option with care. This honors the
1175 <option>--runtime</option> option to only mask temporarily
1176 until the next reboot of the system. The <option>--now</option>
1177 option can be used to ensure that the units are also stopped.</para>
1178 </listitem>
1179 </varlistentry>
1180
1181 <varlistentry>
1182 <term><command>unmask <replaceable>NAME</replaceable>...</command></term>
1183
1184 <listitem>
1185 <para>Unmask one or more unit files, as specified on the
1186 command line. This will undo the effect of
1187 <command>mask</command>.</para>
1188 </listitem>
1189 </varlistentry>
1190
1191 <varlistentry>
1192 <term><command>link <replaceable>FILENAME</replaceable>...</command></term>
1193
1194 <listitem>
1195 <para>Link a unit file that is not in the unit file search
1196 paths into the unit file search path. This requires an
1197 absolute path to a unit file. The effect of this can be
1198 undone with <command>disable</command>. The effect of this
1199 command is that a unit file is available for
1200 <command>start</command> and other commands although it
1201 is not installed directly in the unit search path.</para>
1202 </listitem>
1203 </varlistentry>
1204
1205 <varlistentry>
1206 <term><command>add-wants <replaceable>TARGET</replaceable>
1207 <replaceable>NAME</replaceable>...</command></term>
1208 <term><command>add-requires <replaceable>TARGET</replaceable>
1209 <replaceable>NAME</replaceable>...</command></term>
1210
1211 <listitem>
1212 <para>Adds <literal>Wants=</literal> or <literal>Requires=</literal>
1213 dependency, respectively, to the specified
1214 <replaceable>TARGET</replaceable> for one or more units. </para>
1215
1216 <para>This command honors <option>--system</option>,
1217 <option>--user</option>, <option>--runtime</option> and
1218 <option>--global</option> in a similar way as
1219 <command>enable</command>.</para>
1220
1221 </listitem>
1222 </varlistentry>
1223
1224 <varlistentry>
1225 <term><command>edit <replaceable>NAME</replaceable>...</command></term>
1226
1227 <listitem>
1228 <para>Edit a drop-in snippet or a whole replacement file if
1229 <option>--full</option> is specified, to extend or override the
1230 specified unit.</para>
1231
1232 <para>Depending on whether <option>--system</option> (the default),
1233 <option>--user</option>, or <option>--global</option> is specified,
1234 this creates a drop-in file for each unit either for the system,
1235 for the calling user or for all futures logins of all users. Then,
1236 the editor (see the "Environment" section below) is invoked on
1237 temporary files which will be written to the real location if the
1238 editor exits successfully.</para>
1239
1240 <para>If <option>--full</option> is specified, this will copy the
1241 original units instead of creating drop-in files.</para>
1242
1243 <para>If <option>--runtime</option> is specified, the changes will
1244 be made temporarily in <filename>/run</filename> and they will be
1245 lost on the next reboot.</para>
1246
1247 <para>If the temporary file is empty upon exit the modification of
1248 the related unit is canceled</para>
1249
1250 <para>After the units have been edited, systemd configuration is
1251 reloaded (in a way that is equivalent to <command>daemon-reload</command>).
1252 </para>
1253
1254 <para>Note that this command cannot be used to remotely edit units
1255 and that you cannot temporarily edit units which are in
1256 <filename>/etc</filename> since they take precedence over
1257 <filename>/run</filename>.</para>
1258 </listitem>
1259 </varlistentry>
1260
1261 <varlistentry>
1262 <term><command>get-default</command></term>
1263
1264 <listitem>
1265 <para>Return the default target to boot into. This returns
1266 the target unit name <filename>default.target</filename>
1267 is aliased (symlinked) to.</para>
1268 </listitem>
1269 </varlistentry>
1270
1271 <varlistentry>
1272 <term><command>set-default <replaceable>NAME</replaceable></command></term>
1273
1274 <listitem>
1275 <para>Set the default target to boot into. This sets
1276 (symlinks) the <filename>default.target</filename> alias
1277 to the given target unit.</para>
1278 </listitem>
1279 </varlistentry>
1280
1281 </variablelist>
1282 </refsect2>
1283
1284 <refsect2>
1285 <title>Machine Commands</title>
1286
1287 <variablelist>
1288 <varlistentry>
1289 <term><command>list-machines <optional><replaceable>PATTERN</replaceable>...</optional></command></term>
1290
1291 <listitem>
1292 <para>List the host and all running local containers with
1293 their state. If one or more
1294 <replaceable>PATTERN</replaceable>s are specified, only
1295 containers matching one of them are shown.
1296 </para>
1297 </listitem>
1298 </varlistentry>
1299 </variablelist>
1300 </refsect2>
1301
1302 <refsect2>
1303 <title>Job Commands</title>
1304
1305 <variablelist>
1306 <varlistentry>
1307 <term><command>list-jobs <optional><replaceable>PATTERN...</replaceable></optional></command></term>
1308
1309 <listitem>
1310 <para>List jobs that are in progress. If one or more
1311 <replaceable>PATTERN</replaceable>s are specified, only
1312 jobs for units matching one of them are shown.</para>
1313 </listitem>
1314 </varlistentry>
1315 <varlistentry>
1316 <term><command>cancel <replaceable>JOB</replaceable>...</command></term>
1317
1318 <listitem>
1319 <para>Cancel one or more jobs specified on the command line
1320 by their numeric job IDs. If no job ID is specified, cancel
1321 all pending jobs.</para>
1322 </listitem>
1323 </varlistentry>
1324 </variablelist>
1325 </refsect2>
1326
1327 <refsect2>
1328 <title>Snapshot Commands</title>
1329
1330 <variablelist>
1331 <varlistentry>
1332 <term><command>snapshot <optional><replaceable>NAME</replaceable></optional></command></term>
1333
1334 <listitem>
1335 <para>Create a snapshot. If a snapshot name is specified,
1336 the new snapshot will be named after it. If none is
1337 specified, an automatic snapshot name is generated. In
1338 either case, the snapshot name used is printed to standard
1339 output, unless <option>--quiet</option> is specified.
1340 </para>
1341
1342 <para>A snapshot refers to a saved state of the systemd
1343 manager. It is implemented itself as a unit that is
1344 generated dynamically with this command and has dependencies
1345 on all units active at the time. At a later time, the user
1346 may return to this state by using the
1347 <command>isolate</command> command on the snapshot unit.
1348 </para>
1349
1350 <para>Snapshots are only useful for saving and restoring
1351 which units are running or are stopped, they do not
1352 save/restore any other state. Snapshots are dynamic and lost
1353 on reboot.</para>
1354 </listitem>
1355 </varlistentry>
1356 <varlistentry>
1357 <term><command>delete <replaceable>PATTERN</replaceable>...</command></term>
1358
1359 <listitem>
1360 <para>Remove a snapshot previously created with
1361 <command>snapshot</command>.</para>
1362 </listitem>
1363 </varlistentry>
1364 </variablelist>
1365 </refsect2>
1366
1367 <refsect2>
1368 <title>Environment Commands</title>
1369
1370 <variablelist>
1371 <varlistentry>
1372 <term><command>show-environment</command></term>
1373
1374 <listitem>
1375 <para>Dump the systemd manager environment block. The
1376 environment block will be dumped in straight-forward form
1377 suitable for sourcing into a shell script. This environment
1378 block will be passed to all processes the manager
1379 spawns.</para>
1380 </listitem>
1381 </varlistentry>
1382 <varlistentry>
1383 <term><command>set-environment <replaceable>VARIABLE=VALUE</replaceable>...</command></term>
1384
1385 <listitem>
1386 <para>Set one or more systemd manager environment variables,
1387 as specified on the command line.</para>
1388 </listitem>
1389 </varlistentry>
1390 <varlistentry>
1391 <term><command>unset-environment <replaceable>VARIABLE</replaceable>...</command></term>
1392
1393 <listitem>
1394 <para>Unset one or more systemd manager environment
1395 variables. If only a variable name is specified, it will be
1396 removed regardless of its value. If a variable and a value
1397 are specified, the variable is only removed if it has the
1398 specified value.</para>
1399 </listitem>
1400 </varlistentry>
1401 <varlistentry>
1402 <term>
1403 <command>import-environment</command>
1404 <optional><replaceable>VARIABLE...</replaceable></optional>
1405 </term>
1406
1407 <listitem>
1408 <para>Import all, one or more environment variables set on
1409 the client into the systemd manager environment block. If
1410 no arguments are passed, the entire environment block is
1411 imported. Otherwise, a list of one or more environment
1412 variable names should be passed, whose client-side values
1413 are then imported into the manager's environment
1414 block.</para>
1415 </listitem>
1416 </varlistentry>
1417 </variablelist>
1418 </refsect2>
1419
1420 <refsect2>
1421 <title>Manager Lifecycle Commands</title>
1422
1423 <variablelist>
1424 <varlistentry>
1425 <term><command>daemon-reload</command></term>
1426
1427 <listitem>
1428 <para>Reload systemd manager configuration. This will
1429 rerun all generators (see
1430 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>),
1431 reload all unit files, and recreate the entire dependency
1432 tree. While the daemon is being reloaded, all sockets
1433 systemd listens on behalf of user configuration will stay
1434 accessible.</para>
1435
1436 <para>This command should not be confused with the
1437 <command>reload</command> command.</para>
1438 </listitem>
1439 </varlistentry>
1440 <varlistentry>
1441 <term><command>daemon-reexec</command></term>
1442
1443 <listitem>
1444 <para>Reexecute the systemd manager. This will serialize the
1445 manager state, reexecute the process and deserialize the
1446 state again. This command is of little use except for
1447 debugging and package upgrades. Sometimes, it might be
1448 helpful as a heavy-weight <command>daemon-reload</command>.
1449 While the daemon is being reexecuted, all sockets systemd listening
1450 on behalf of user configuration will stay accessible.
1451 </para>
1452 </listitem>
1453 </varlistentry>
1454 </variablelist>
1455 </refsect2>
1456
1457 <refsect2>
1458 <title>System Commands</title>
1459
1460 <variablelist>
1461 <varlistentry>
1462 <term><command>is-system-running</command></term>
1463
1464 <listitem>
1465 <para>Checks whether the system is operational. This
1466 returns success when the system is fully up and running,
1467 meaning not in startup, shutdown or maintenance
1468 mode. Failure is returned otherwise. In addition, the
1469 current state is printed in a short string to standard
1470 output, see table below. Use <option>--quiet</option> to
1471 suppress this output.</para>
1472
1473 <table>
1474 <title>Manager Operational States</title>
1475 <tgroup cols='2'>
1476 <colspec colname='name' />
1477 <colspec colname='description' />
1478 <thead>
1479 <row>
1480 <entry>Name</entry>
1481 <entry>Description</entry>
1482 </row>
1483 </thead>
1484 <tbody>
1485 <row>
1486 <entry><varname>initializing</varname></entry>
1487 <entry><para>Early bootup, before
1488 <filename>basic.target</filename> is reached
1489 or the <varname>maintenance</varname> state entered.
1490 </para></entry>
1491 </row>
1492 <row>
1493 <entry><varname>starting</varname></entry>
1494 <entry><para>Late bootup, before the job queue
1495 becomes idle for the first time, or one of the
1496 rescue targets are reached.</para></entry>
1497 </row>
1498 <row>
1499 <entry><varname>running</varname></entry>
1500 <entry><para>The system is fully
1501 operational.</para></entry>
1502 </row>
1503 <row>
1504 <entry><varname>degraded</varname></entry>
1505 <entry><para>The system is operational but one or more
1506 units failed.</para></entry>
1507 </row>
1508 <row>
1509 <entry><varname>maintenance</varname></entry>
1510 <entry><para>The rescue or emergency target is
1511 active.</para></entry>
1512 </row>
1513 <row>
1514 <entry><varname>stopping</varname></entry>
1515 <entry><para>The manager is shutting
1516 down.</para></entry>
1517 </row>
1518 </tbody>
1519 </tgroup>
1520 </table>
1521 </listitem>
1522 </varlistentry>
1523
1524 <varlistentry>
1525 <term><command>default</command></term>
1526
1527 <listitem>
1528 <para>Enter default mode. This is mostly equivalent to
1529 <command>isolate default.target</command>.</para>
1530 </listitem>
1531 </varlistentry>
1532
1533 <varlistentry>
1534 <term><command>rescue</command></term>
1535
1536 <listitem>
1537 <para>Enter rescue mode. This is mostly equivalent to
1538 <command>isolate rescue.target</command>, but also prints a
1539 wall message to all users.</para>
1540 </listitem>
1541 </varlistentry>
1542 <varlistentry>
1543 <term><command>emergency</command></term>
1544
1545 <listitem>
1546 <para>Enter emergency mode. This is mostly equivalent to
1547 <command>isolate emergency.target</command>, but also prints
1548 a wall message to all users.</para>
1549 </listitem>
1550 </varlistentry>
1551 <varlistentry>
1552 <term><command>halt</command></term>
1553
1554 <listitem>
1555 <para>Shut down and halt the system. This is mostly equivalent to
1556 <command>start halt.target --job-mode=replace-irreversibly</command>, but also
1557 prints a wall message to all users. If combined with
1558 <option>--force</option>, shutdown of all running services is
1559 skipped, however all processes are killed and all file
1560 systems are unmounted or mounted read-only, immediately
1561 followed by the system halt. If <option>--force</option> is
1562 specified twice, the operation is immediately executed
1563 without terminating any processes or unmounting any file
1564 systems. This may result in data loss.</para>
1565 </listitem>
1566 </varlistentry>
1567 <varlistentry>
1568 <term><command>poweroff</command></term>
1569
1570 <listitem>
1571 <para>Shut down and power-off the system. This is mostly
1572 equivalent to <command>start poweroff.target --job-mode=replace-irreversibly</command>,
1573 but also prints a wall message to all users. If combined with
1574 <option>--force</option>, shutdown of all running services is
1575 skipped, however all processes are killed and all file
1576 systems are unmounted or mounted read-only, immediately
1577 followed by the powering off. If <option>--force</option> is
1578 specified twice, the operation is immediately executed
1579 without terminating any processes or unmounting any file
1580 systems. This may result in data loss.</para>
1581 </listitem>
1582 </varlistentry>
1583 <varlistentry>
1584 <term><command>reboot <optional><replaceable>arg</replaceable></optional></command></term>
1585
1586 <listitem>
1587 <para>Shut down and reboot the system. This is mostly
1588 equivalent to <command>start reboot.target --job-mode=replace-irreversibly</command>,
1589 but also prints a wall message to all users. If combined with
1590 <option>--force</option>, shutdown of all running services is
1591 skipped, however all processes are killed and all file
1592 systems are unmounted or mounted read-only, immediately
1593 followed by the reboot. If <option>--force</option> is
1594 specified twice, the operation is immediately executed
1595 without terminating any processes or unmounting any file
1596 systems. This may result in data loss.</para>
1597
1598 <para>If the optional argument
1599 <replaceable>arg</replaceable> is given, it will be passed
1600 as the optional argument to the
1601 <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
1602 system call. The value is architecture and firmware
1603 specific. As an example, <literal>recovery</literal> might
1604 be used to trigger system recovery, and
1605 <literal>fota</literal> might be used to trigger a
1606 <quote>firmware over the air</quote> update.</para>
1607 </listitem>
1608 </varlistentry>
1609
1610 <varlistentry>
1611 <term><command>kexec</command></term>
1612
1613 <listitem>
1614 <para>Shut down and reboot the system via kexec. This is
1615 mostly equivalent to <command>start kexec.target --job-mode=replace-irreversibly</command>,
1616 but also prints a wall message to all users. If combined
1617 with <option>--force</option>, shutdown of all running
1618 services is skipped, however all processes are killed and
1619 all file systems are unmounted or mounted read-only,
1620 immediately followed by the reboot.</para>
1621 </listitem>
1622 </varlistentry>
1623
1624 <varlistentry>
1625 <term><command>exit</command></term>
1626
1627 <listitem>
1628 <para>Ask the systemd manager to quit. This is only
1629 supported for user service managers (i.e. in conjunction
1630 with the <option>--user</option> option) and will fail
1631 otherwise.</para>
1632 </listitem>
1633 </varlistentry>
1634
1635 <varlistentry>
1636 <term><command>switch-root <replaceable>ROOT</replaceable> <optional><replaceable>INIT</replaceable></optional></command></term>
1637
1638 <listitem>
1639 <para>Switches to a different root directory and executes a
1640 new system manager process below it. This is intended for
1641 usage in initial RAM disks ("initrd"), and will transition
1642 from the initrd's system manager process (a.k.a "init"
1643 process) to the main system manager process. This call takes two
1644 arguments: the directory that is to become the new root directory, and
1645 the path to the new system manager binary below it to
1646 execute as PID 1. If the latter is omitted or the empty
1647 string, a systemd binary will automatically be searched for
1648 and used as init. If the system manager path is omitted or
1649 equal to the empty string, the state of the initrd's system
1650 manager process is passed to the main system manager, which
1651 allows later introspection of the state of the services
1652 involved in the initrd boot.</para>
1653 </listitem>
1654 </varlistentry>
1655
1656 <varlistentry>
1657 <term><command>suspend</command></term>
1658
1659 <listitem>
1660 <para>Suspend the system. This will trigger activation of
1661 the special <filename>suspend.target</filename> target.
1662 </para>
1663 </listitem>
1664 </varlistentry>
1665
1666 <varlistentry>
1667 <term><command>hibernate</command></term>
1668
1669 <listitem>
1670 <para>Hibernate the system. This will trigger activation of
1671 the special <filename>hibernate.target</filename> target.
1672 </para>
1673 </listitem>
1674 </varlistentry>
1675
1676 <varlistentry>
1677 <term><command>hybrid-sleep</command></term>
1678
1679 <listitem>
1680 <para>Hibernate and suspend the system. This will trigger
1681 activation of the special
1682 <filename>hybrid-sleep.target</filename> target.</para>
1683 </listitem>
1684 </varlistentry>
1685 </variablelist>
1686 </refsect2>
1687
1688 <refsect2>
1689 <title>Parameter Syntax</title>
1690
1691 <para>Unit commands listed above take either a single unit name
1692 (designated as <replaceable>NAME</replaceable>), or multiple
1693 unit specifications (designated as
1694 <replaceable>PATTERN</replaceable>...). In the first case, the
1695 unit name with or without a suffix must be given. If the suffix
1696 is not specified, systemctl will append a suitable suffix,
1697 <literal>.service</literal> by default, and a type-specific
1698 suffix in case of commands which operate only on specific unit
1699 types. For example,
1700 <programlisting># systemctl start sshd</programlisting> and
1701 <programlisting># systemctl start sshd.service</programlisting>
1702 are equivalent, as are
1703 <programlisting># systemctl isolate default</programlisting>
1704 and
1705 <programlisting># systemctl isolate default.target</programlisting>
1706 Note that (absolute) paths to device nodes are automatically
1707 converted to device unit names, and other (absolute) paths to
1708 mount unit names.
1709 <programlisting># systemctl status /dev/sda
1710 # systemctl status /home</programlisting>
1711 are equivalent to:
1712 <programlisting># systemctl status dev-sda.device
1713 # systemctl status home.mount</programlisting>
1714 In the second case, shell-style globs will be matched against
1715 currently loaded units; literal unit names, with or without
1716 a suffix, will be treated as in the first case. This means that
1717 literal unit names always refer to exactly one unit, but globs
1718 may match zero units and this is not considered an error.</para>
1719
1720 <para>Glob patterns use
1721 <citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
1722 so normal shell-style globbing rules are used, and
1723 <literal>*</literal>, <literal>?</literal>,
1724 <literal>[]</literal> may be used. See
1725 <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1726 for more details. The patterns are matched against the names of
1727 currently loaded units, and patterns which do not match anything
1728 are silently skipped. For example:
1729 <programlisting># systemctl stop sshd@*.service</programlisting>
1730 will stop all <filename>sshd@.service</filename> instances.
1731 </para>
1732
1733 <para>For unit file commands, the specified
1734 <replaceable>NAME</replaceable> should be the full name of the
1735 unit file, or the absolute path to the unit file:
1736 <programlisting># systemctl enable foo.service</programlisting>
1737 or
1738 <programlisting># systemctl link /path/to/foo.service</programlisting>
1739 </para>
1740 </refsect2>
1741
1742 </refsect1>
1743
1744 <refsect1>
1745 <title>Exit status</title>
1746
1747 <para>On success, 0 is returned, a non-zero failure
1748 code otherwise.</para>
1749 </refsect1>
1750
1751 <refsect1>
1752 <title>Environment</title>
1753
1754 <variablelist class='environment-variables'>
1755 <varlistentry>
1756 <term><varname>$SYSTEMD_EDITOR</varname></term>
1757
1758 <listitem><para>Editor to use when editing units; overrides
1759 <varname>$EDITOR</varname> and <varname>$VISUAL</varname>. If neither
1760 <varname>$SYSTEMD_EDITOR</varname> nor <varname>$EDITOR</varname> nor
1761 <varname>$VISUAL</varname> are present or if it is set to an empty
1762 string or if their execution failed, systemctl will try to execute well
1763 known editors in this order:
1764 <citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1765 <citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1766 <citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1767 <citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1768 </para></listitem>
1769 </varlistentry>
1770 </variablelist>
1771 <xi:include href="less-variables.xml" xpointer="pager"/>
1772 <xi:include href="less-variables.xml" xpointer="less"/>
1773 </refsect1>
1774
1775 <refsect1>
1776 <title>See Also</title>
1777 <para>
1778 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1779 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1780 <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1781 <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1782 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1783 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1784 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1785 <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1786 <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1787 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1788 <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1789 </para>
1790 </refsect1>
1791
1792 </refentry>