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