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