]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemctl.xml
udev: reset /proc/self/oom_score_adj in worker processes
[thirdparty/systemd.git] / man / systemctl.xml
CommitLineData
7874bcd6
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5<!--
6 This file is part of systemd.
7
8 Copyright 2010 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
7874bcd6
LP
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 18 Lesser General Public License for more details.
7874bcd6 19
5430f7f2 20 You should have received a copy of the GNU Lesser General Public License
7874bcd6
LP
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22-->
23
ee5762e3 24<refentry id="systemctl">
7874bcd6
LP
25
26 <refentryinfo>
27 <title>systemctl</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>systemctl</refentrytitle>
42 <manvolnum>1</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>systemctl</refname>
af2d49f7 47 <refpurpose>Control the systemd system and service manager</refpurpose>
7874bcd6
LP
48 </refnamediv>
49
50 <refsynopsisdiv>
51 <cmdsynopsis>
52 <command>systemctl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
53 </cmdsynopsis>
54 </refsynopsisdiv>
55
56 <refsect1>
57 <title>Description</title>
58
59 <para><command>systemctl</command> may be used to
60 introspect and control the state of the
61 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
af2d49f7 62 system and service manager.</para>
7874bcd6
LP
63 </refsect1>
64
65 <refsect1>
66 <title>Options</title>
67
68 <para>The following options are understood:</para>
69
70 <variablelist>
71 <varlistentry>
72 <term><option>--help</option></term>
7594fb25 73 <term><option>-h</option></term>
7874bcd6
LP
74
75 <listitem><para>Prints a short help
76 text and exits.</para></listitem>
77 </varlistentry>
78
59cddb23
LP
79 <varlistentry>
80 <term><option>--version</option></term>
81
82 <listitem><para>Prints a short version
83 string and exits.</para></listitem>
84 </varlistentry>
85
7874bcd6
LP
86 <varlistentry>
87 <term><option>--type=</option></term>
7594fb25 88 <term><option>-t</option></term>
7874bcd6
LP
89
90 <listitem><para>When listing units,
91 limit display to certain unit
92 types. If not specified units of all
93 types will be shown. The argument
94 should be a unit type name such as
95 <option>service</option>,
96 <option>socket</option> and
97 similar.</para></listitem>
98 </varlistentry>
99
393a2f9b
LP
100 <varlistentry>
101 <term><option>--property=</option></term>
102 <term><option>-p</option></term>
103
104 <listitem><para>When showing
a61933ad 105 unit/job/manager properties, limit
ee5762e3
LP
106 display to certain properties as
107 specified as argument. If not
108 specified all set properties are
393a2f9b
LP
109 shown. The argument should be a
110 property name, such as
ea4a240d
LP
111 <literal>MainPID</literal>. If
112 specified more than once all
113 properties with the specified names
114 are shown.</para></listitem>
393a2f9b
LP
115 </varlistentry>
116
7874bcd6
LP
117 <varlistentry>
118 <term><option>--all</option></term>
7594fb25 119 <term><option>-a</option></term>
7874bcd6
LP
120
121 <listitem><para>When listing units,
122 show all units, regardless of their
393a2f9b 123 state, including inactive units. When
a61933ad 124 showing unit/job/manager properties,
393a2f9b
LP
125 show all properties regardless whether
126 they are set or not.</para></listitem>
7874bcd6
LP
127 </varlistentry>
128
30732560
LP
129 <varlistentry>
130 <term><option>--failed</option></term>
131
132 <listitem><para>When listing units,
133 show only failed units. Do not confuse
134 with
135 <option>--fail</option>.</para></listitem>
136 </varlistentry>
137
8fe914ec
LP
138 <varlistentry>
139 <term><option>--full</option></term>
140
141 <listitem><para>Do not ellipsize unit
f73e33d9
LP
142 names and truncate unit descriptions
143 in the output of
8fe914ec
LP
144 <command>list-units</command> and
145 <command>list-jobs</command>.</para></listitem>
146 </varlistentry>
147
7874bcd6 148 <varlistentry>
90d473a1 149 <term><option>--fail</option></term>
7874bcd6
LP
150
151 <listitem><para>If the requested
ee5762e3
LP
152 operation conflicts with a pending
153 unfinished job, fail the command. If
154 this is not specified the requested
155 operation will replace the pending job,
30732560
LP
156 if necessary. Do not confuse
157 with
158 <option>--failed</option>.</para></listitem>
ee5762e3
LP
159 </varlistentry>
160
e67c3609
LP
161 <varlistentry>
162 <term><option>--ignore-dependencies</option></term>
163
164 <listitem><para>When enqueuing a new
165 job ignore all its dependencies and
166 execute it immediately. If passed no
167 required units of the unit passed will
168 be pulled in, and no ordering
169 dependencies will be honoured. This is
170 mostly a debugging and rescue tool for
171 the administrator and should not be
172 used by
173 applications.</para></listitem>
174 </varlistentry>
175
ee5762e3
LP
176 <varlistentry>
177 <term><option>--quiet</option></term>
178 <term><option>-q</option></term>
179
180 <listitem><para>Suppress output to
181 STDOUT in
182 <command>snapshot</command>,
3d428115 183 <command>is-active</command>,
ee5762e3
LP
184 <command>enable</command> and
185 <command>disable</command>.</para></listitem>
186 </varlistentry>
187
188 <varlistentry>
189 <term><option>--no-block</option></term>
190
a9c72fe9
LP
191 <listitem><para>Do not synchronously wait for
192 the requested operation to finish. If this is
193 not specified the job will be verified,
194 enqueued and <command>systemctl</command> will
195 wait until it is completed. By passing this
196 argument it is only verified and
a61933ad
LP
197 enqueued.</para></listitem>
198 </varlistentry>
ee5762e3 199
0736af98 200 <varlistentry>
ebed32bf
MS
201 <term><option>--no-legend</option></term>
202
203 <listitem><para>Do not print a legend, i.e.
204 the column headers and the footer with hints.
205 </para></listitem>
206 </varlistentry>
207
208 <varlistentry>
0736af98
MV
209 <term><option>--no-pager</option></term>
210
211 <listitem><para>Do not pipe output into a
212 pager.</para></listitem>
213 </varlistentry>
214
ee5762e3
LP
215 <varlistentry>
216 <term><option>--system</option></term>
217
218 <listitem><para>Talk to the systemd
219 system manager. (Default)</para></listitem>
220 </varlistentry>
221
222 <varlistentry>
af2d49f7 223 <term><option>--user</option></term>
ee5762e3
LP
224
225 <listitem><para>Talk to the systemd
af2d49f7 226 manager of the calling user.</para></listitem>
7874bcd6
LP
227 </varlistentry>
228
4445a875
LP
229 <varlistentry>
230 <term><option>--order</option></term>
231 <term><option>--require</option></term>
232
233 <listitem><para>When used in
234 conjunction with the
235 <command>dot</command> command (see
236 below), selects which dependencies are
237 shown in the dependency graph. If
238 <option>--order</option> is passed
239 only dependencies of type
240 <varname>After=</varname> or
241 <varname>Before=</varname> are
242 shown. If <option>--require</option>
243 is passed only dependencies of type
244 <varname>Requires=</varname>,
245 <varname>RequiresOverridable=</varname>,
246 <varname>Requisite=</varname>,
247 <varname>RequisiteOverridable=</varname>,
248 <varname>Wants=</varname> and
249 <varname>Conflicts=</varname> are
250 shown. If neither is passed, shows
251 dependencies of all these
252 types.</para></listitem>
253 </varlistentry>
254
7874bcd6 255 <varlistentry>
ee5762e3 256 <term><option>--no-wall</option></term>
7874bcd6 257
ee5762e3
LP
258 <listitem><para>Don't send wall
259 message before
260 halt, power-off, reboot.</para></listitem>
7874bcd6
LP
261 </varlistentry>
262
263 <varlistentry>
ee5762e3
LP
264 <term><option>--global</option></term>
265
266 <listitem><para>When used with
267 <command>enable</command> and
268 <command>disable</command>, operate on the
3d428115 269 global user configuration
ee5762e3
LP
270 directory, thus enabling or disabling
271 a unit file globally for all future
af2d49f7 272 logins of all users.</para></listitem>
7874bcd6
LP
273 </varlistentry>
274
275 <varlistentry>
ee5762e3
LP
276 <term><option>--no-reload</option></term>
277
278 <listitem><para>When used with
279 <command>enable</command> and
280 <command>disable</command>, do not
281 implicitly reload daemon configuration
282 after executing the
283 changes.</para></listitem>
284 </varlistentry>
7594fb25 285
501fc174
LP
286 <varlistentry>
287 <term><option>--no-ask-password</option></term>
288
289 <listitem><para>When used with
290 <command>start</command> and related
291 commands, disables asking for
292 passwords. Background services may
293 require input of a password or
294 passphrase string, for example to
295 unlock system hard disks or
296 cryptographic certificates. Unless
297 this option is specified and the
298 command is invoked from a terminal
299 <command>systemctl</command> will
300 query the user on the terminal for the
301 necessary secrets. Use this option to
6bb92a16
LP
302 switch this behavior off. In this case
303 the password must be supplied by some
304 other means (for example graphical
305 password agents) or the service might
306 fail. This also disables querying the
307 user for authentication for privileged
308 operations.</para></listitem>
501fc174
LP
309 </varlistentry>
310
8a0867d6
LP
311 <varlistentry>
312 <term><option>--kill-who=</option></term>
313
314 <listitem><para>When used with
315 <command>kill</command>, choose which
316 processes to kill. Must be one of
317 <option>main</option>,
318 <option>control</option> or
319 <option>all</option> to select whether
320 to kill only the main process of the
321 unit, the control process or all
3d428115 322 processes of the unit. If omitted
8a0867d6
LP
323 defaults to
324 <option>all</option>.</para></listitem>
325 </varlistentry>
326
327 <varlistentry>
3d428115 328 <term><option>--signal=</option></term>
8a0867d6
LP
329 <term><option>-s</option></term>
330
331 <listitem><para>When used with
332 <command>kill</command>, choose which
333 signal to send to selected
334 processes. Must be one of the well
3d428115 335 known signal specifiers such as
8a0867d6 336 SIGTERM, SIGINT or SIGSTOP. If
3d428115 337 omitted defaults to
8a0867d6
LP
338 <option>SIGTERM</option>.</para></listitem>
339 </varlistentry>
340
7594fb25 341 <varlistentry>
ee5762e3 342 <term><option>--force</option></term>
6f352544 343 <term><option>-f</option></term>
7874bcd6 344
ee5762e3 345 <listitem><para>When used with
7cf55dd0 346 <command>enable</command>, overwrite any
ee5762e3
LP
347 existing conflicting
348 symlinks.</para></listitem>
6f352544
LP
349
350 <listitem><para>When used with
351 <command>halt</command>,
352 <command>poweroff</command>,
353 <command>reboot</command> or
e606bb61 354 <command>kexec</command> execute the
6f352544
LP
355 selected operation without shutting
356 down all units. However, all processes
357 will be killed forcibly and all file
358 systems are unmounted or remounted
359 read-only. This is hence a drastic but
360 relatively safe option to request an
e606bb61
LP
361 immediate reboot. If
362 <option>--force</option> is specified
363 twice for these operations, they will
364 be executed immediately without
365 terminating any processes or umounting
366 any file systems. Warning: specifying
367 <option>--force</option> twice with
368 any of these operations might result
369 in data loss.</para></listitem>
7874bcd6
LP
370 </varlistentry>
371
372 <varlistentry>
729e3769 373 <term><option>--root=</option></term>
ee5762e3
LP
374
375 <listitem><para>When used with
729e3769
LP
376 <command>enable</command>/<command>disable</command>/<command>is-enabled</command> (and
377 related commands), use alternative
378 root path when looking for unit
379 files.</para></listitem>
7874bcd6 380 </varlistentry>
a8f11321 381
be394c48 382 <varlistentry>
729e3769 383 <term><option>--runtime</option></term>
be394c48
FC
384
385 <listitem><para>When used with
729e3769
LP
386 <command>enable</command>/<command>disable</command>/<command>is-enabled</command> (and related commands), make
387 changes only temporarily, so that they
388 are dropped on the next reboot. This
389 will have the effect that changes are
390 not made in subdirectories of
391 <filename>/etc</filename> but in
392 <filename>/run</filename>, with
393 identical immediate effects, however,
394 since the latter is lost on reboot,
395 the changes are lost
396 too.</para></listitem>
be394c48
FC
397 </varlistentry>
398
a8f11321
LP
399 <varlistentry>
400 <term><option>-H</option></term>
401 <term><option>--host</option></term>
402
403 <listitem><para>Execute operation
9f7dad77
VS
404 remotely. Specify a hostname, or
405 username and hostname separated by @,
a8f11321
LP
406 to connect to. This will use SSH to
407 talk to the remote systemd
408 instance.</para></listitem>
409 </varlistentry>
410
411 <varlistentry>
412 <term><option>-P</option></term>
413 <term><option>--privileged</option></term>
414
415 <listitem><para>Acquire privileges via
416 PolicyKit before executing the
417 operation.</para></listitem>
418 </varlistentry>
5c3246b1
LP
419
420 <varlistentry>
421 <term><option>--lines=</option></term>
422 <term><option>-n</option></term>
423
424 <listitem><para>When used with
425 <command>status</command> controls the
426 number of journal lines to show,
427 counting from the most recent
428 ones. Takes a positive integer
429 argument. Defaults to
430 10.</para></listitem>
431 </varlistentry>
432
433 <varlistentry>
434 <term><option>--follow</option></term>
568b679f 435 <term><option>-f</option></term>
5c3246b1
LP
436
437 <listitem><para>When used with
438 <command>status</command> continously
439 prints new journal entries as they are
440 appended to the
441 journal.</para></listitem>
442 </varlistentry>
443
444 <varlistentry>
445 <term><option>--output=</option></term>
446 <term><option>-o</option></term>
447
448 <listitem><para>When used with
449 <command>status</command> controls the
450 formatting of the journal entries that
451 are shown. For the available choices
452 see
169c4f65 453 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>. Defaults
5c3246b1
LP
454 to
455 <literal>short</literal>.</para></listitem>
456 </varlistentry>
457
7874bcd6
LP
458 </variablelist>
459
460 <para>The following commands are understood:</para>
461
462 <variablelist>
463 <varlistentry>
464 <term><command>list-units</command></term>
465
466 <listitem><para>List known units.</para></listitem>
467 </varlistentry>
7874bcd6
LP
468 <varlistentry>
469 <term><command>start [NAME...]</command></term>
470
ee5762e3
LP
471 <listitem><para>Start (activate) one
472 or more units specified on the command
7874bcd6
LP
473 line.</para></listitem>
474 </varlistentry>
475 <varlistentry>
476 <term><command>stop [NAME...]</command></term>
477
ee5762e3
LP
478 <listitem><para>Stop (deactivate) one
479 or more units specified on the command
7874bcd6
LP
480 line.</para></listitem>
481 </varlistentry>
7874bcd6
LP
482 <varlistentry>
483 <term><command>reload [NAME...]</command></term>
484
ee5762e3
LP
485 <listitem><para>Asks all units listed
486 on the command line to reload their
7874bcd6 487 configuration. Note that this will
ee5762e3
LP
488 reload the service-specific
489 configuration, not the unit
490 configuration file of systemd. If you
491 want systemd to reload the
492 configuration file of a unit use the
7874bcd6
LP
493 <command>daemon-reload</command>
494 command. In other words: for the
495 example case of Apache, this will
496 reload Apache's
497 <filename>httpd.conf</filename> in the
498 web server, not the
499 <filename>apache.service</filename>
ee5762e3
LP
500 systemd unit file. </para>
501
502 <para>This command should not be
503 confused with the
504 <command>daemon-reload</command> or
505 <command>load</command>
7874bcd6
LP
506 commands.</para></listitem>
507
508 </varlistentry>
509 <varlistentry>
6f28c033
LP
510 <term><command>restart [NAME...]</command></term>
511
512 <listitem><para>Restart one or more
513 units specified on the command
514 line. If the units are not running yet
515 they will be
516 started.</para></listitem>
517 </varlistentry>
518 <varlistentry>
519 <term><command>try-restart [NAME...]</command></term>
520
521 <listitem><para>Restart one or more
522 units specified on the command
f1f8cfd0
AB
523 line if the units are running. Do
524 nothing if units are not running.
525 Note that for compatibility
9bee76ee
RB
526 with Red Hat init scripts
527 <command>condrestart</command> is
528 equivalent to this command.</para></listitem>
6f28c033
LP
529 </varlistentry>
530 <varlistentry>
531 <term><command>reload-or-restart [NAME...]</command></term>
9bee76ee
RB
532
533 <listitem><para>Reload one or more
534 units if they support it. If not,
535 restart them instead. If the units
536 are not running yet they will be
537 started.</para></listitem>
538 </varlistentry>
539 <varlistentry>
6f28c033
LP
540 <term><command>reload-or-try-restart [NAME...]</command></term>
541
542 <listitem><para>Reload one or more
ee5762e3 543 units if they support it. If not,
100fd567
LP
544 restart them instead. Do nothing if
545 the units are not running. Note that
546 for compatibility with SysV init
547 scripts
9bee76ee 548 <command>force-reload</command> is
100fd567
LP
549 equivalent to this
550 command.</para></listitem>
6f28c033
LP
551 </varlistentry>
552 <varlistentry>
7874bcd6
LP
553 <term><command>isolate [NAME]</command></term>
554
555 <listitem><para>Start the unit
556 specified on the command line and its
25f63d46
MM
557 dependencies and stop all others.</para>
558
559 <para>This is similar to changing the
560 runlevel in a traditional init system. The
561 <command>isolate</command> command will
562 immediately stop processes that are not
563 enabled in the new unit, possibly including
564 the graphical environment or terminal you
565 are currently using.</para>
566
567 <para>Note that this works only on units
568 where <option>AllowIsolate=</option> is
2528a7a6
LP
569 enabled. See
570 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
571 for details.</para></listitem>
7874bcd6 572 </varlistentry>
8a0867d6
LP
573 <varlistentry>
574 <term><command>kill [NAME...]</command></term>
575
576 <listitem><para>Send a signal to one
577 or more processes of the unit. Use
578 <option>--kill-who=</option> to select
579 which process to kill. Use
580 <option>--kill-mode=</option> to
581 select the kill mode and
582 <option>--signal=</option> to select
583 the signal to send.</para></listitem>
584 </varlistentry>
7594fb25 585 <varlistentry>
ee5762e3 586 <term><command>is-active [NAME...]</command></term>
7594fb25
LP
587
588 <listitem><para>Check whether any of
3d428115 589 the specified units are active
ee5762e3
LP
590 (i.e. running). Returns an exit code
591 0 if at least one is active, non-zero
7594fb25
LP
592 otherwise. Unless
593 <option>--quiet</option> is specified
594 this will also print the current unit
595 state to STDOUT.</para></listitem>
596 </varlistentry>
61cbdc4b 597 <varlistentry>
75676b72 598 <term><command>status [NAME...|PID...]</command></term>
61cbdc4b 599
ee5762e3
LP
600 <listitem><para>Show terse runtime
601 status information about one or more
5c3246b1
LP
602 units, followed by its most recent log
603 data from the journal. This function
604 is intended to generate human-readable
605 output. If you are looking for
606 computer-parsable output, use
607 <command>show</command> instead. If a
608 PID is passed information about the
609 unit the process of the PID belongs to
610 is shown.</para></listitem>
61cbdc4b 611 </varlistentry>
393a2f9b
LP
612 <varlistentry>
613 <term><command>show [NAME...|JOB...]</command></term>
614
ee5762e3
LP
615 <listitem><para>Show properties of one
616 or more units, jobs or the manager
393a2f9b 617 itself. If no argument is specified
61cbdc4b 618 properties of the manager will be
393a2f9b 619 shown. If a unit name is specified
ee5762e3
LP
620 properties of the unit is shown, and
621 if a job id is specified properties of
622 the job is shown. By default, empty
623 properties are suppressed. Use
624 <option>--all</option> to show those
625 too. To select specific properties to
626 show use
627 <option>--property=</option>. This
628 command is intended to be used
629 whenever computer-parsable output is
630 required. Use
631 <command>status</command> if you are
632 looking for formatted human-readable
633 output.</para></listitem>
393a2f9b 634 </varlistentry>
256425cc
LP
635 <varlistentry>
636 <term><command>man [NAME...|PID...]</command></term>
5632e374 637
256425cc
LP
638 <listitem><para>Show manual pages for
639 one or more units, if available. If a
640 PID is passed the manual pages for the
641 unit the process of the PID belongs to
642 is shown.</para></listitem>
643 </varlistentry>
5632e374 644 <varlistentry>
74ac3cbd
MM
645 <term><command>reset-failed [NAME...]</command></term>
646
647 <listitem><para>Reset the
648 '<literal>failed</literal>' state of the
649 specified units, or if no unit name is
650 passed of all units. When a unit fails
651 in some way (i.e. process exiting with
652 non-zero error code, terminating
653 abnormally or timing out) it will
654 automatically enter the
655 '<literal>failed</literal>' state and
656 its exit code and status is recorded
657 for introspection by the administrator
5632e374
LP
658 until the service is restarted or
659 reset with this
660 command.</para></listitem>
661 </varlistentry>
662
7e13bea0
RB
663 <varlistentry>
664 <term><command>list-unit-files</command></term>
665
666 <listitem><para>List installed unit files.
667 </para></listitem>
668 </varlistentry>
669
ee5762e3
LP
670 <varlistentry>
671 <term><command>enable [NAME...]</command></term>
672
673 <listitem><para>Enable one or more
674 unit files, as specified on the
675 command line. This will create a
676 number of symlinks as encoded in the
677 <literal>[Install]</literal> sections
678 of the unit files. After the symlinks
679 have been created the systemd
680 configuration is reloaded (in a way
681 that is equivalent to
682 <command>daemon-reload</command>) to
683 ensure the changes are taken into
684 account immediately. Note that this
685 does not have the effect that any of
686 the units enabled are also started at
687 the same time. If this is desired a
96d4ce01 688 separate <command>start</command>
ee5762e3
LP
689 command must be invoked for the
690 unit.</para>
691
692 <para>This command will
693 print the actions executed. This
694 output may be suppressed by passing
695 <option>--quiet</option>.</para>
696
697 <para>Note that this operation creates
698 only the suggested symlinks for the
699 units. While this command is the
700 recommended way to manipulate the unit
701 configuration directory, the
702 administrator is free to make
703 additional changes manually, by
704 placing or removing symlinks in the
3d428115 705 directory. This is particularly useful
ee5762e3
LP
706 to create configurations that deviate
707 from the suggested default
708 installation. In this case the
709 administrator must make sure to invoke
710 <command>daemon-reload</command>
711 manually as necessary, to ensure his
712 changes are taken into account.</para>
713
714 <para>Enabling units should not be
715 confused with starting (activating)
716 units, as done by the
717 <command>start</command>
718 command. Enabling and starting units
719 is orthogonal: units may be enabled
720 without being started and started
721 without being enabled. Enabling simply
722 hooks the unit into various suggested
723 places (for example, so that the unit
724 is automatically started on boot or
725 when a particular kind of hardware is
726 plugged in). Starting actually spawns
727 the daemon process (in case of service
728 units), or binds the socket (in case
729 of socket units), and so
730 on.</para>
731
732 <para>Depending on whether
733 <option>--system</option>,
af2d49f7 734 <option>--user</option> or
ee5762e3
LP
735 <option>--global</option> is specified
736 this enables the unit for the system,
af2d49f7
LP
737 for the calling user only
738 or for all future logins of all
ee5762e3
LP
739 users. Note that in the latter case no
740 systemd daemon configuration is
741 reloaded.</para>
742 </listitem>
743 </varlistentry>
744
745 <varlistentry>
746 <term><command>disable [NAME...]</command></term>
747
748 <listitem><para>Disables one or more
749 units. This removes all symlinks to
750 the specified unit files from the unit
751 configuration directory, and hence
752 undoes the changes made by
753 <command>enable</command>. Note
729e3769 754 however that this removes
ee5762e3
LP
755 all symlinks to the unit files
756 (i.e. including manual additions), not
757 just those actually created by
729e3769 758 <command>enable</command>. This call
ee5762e3
LP
759 implicitly reloads the systemd daemon
760 configuration after completing the
761 disabling of the units. Note that this
762 command does not implicitly stop the
763 units that is being disabled. If this
764 is desired an additional
6a2857e6 765 <command>stop</command> command should
ee5762e3
LP
766 be executed afterwards.</para>
767
768 <para>This command will print the
769 actions executed. This output may be
770 suppressed by passing
771 <option>--quiet</option>.</para>
772 </listitem>
773
3d428115 774 <para>This command honors
ee5762e3 775 <option>--system</option>,
af2d49f7 776 <option>--user</option>,
ee5762e3
LP
777 <option>--global</option> in a similar
778 way as
779 <command>enable</command>.</para>
780 </varlistentry>
781
782 <varlistentry>
783 <term><command>is-enabled [NAME...]</command></term>
784
785 <listitem><para>Checks whether any of
786 the specified unit files is enabled
787 (as with
788 <command>enable</command>). Returns an
789 exit code of 0 if at least one is
729e3769
LP
790 enabled, non-zero otherwise. Prints
791 the current enable status. To suppress
792 this output use
793 <option>--quiet</option>.</para></listitem>
794 </varlistentry>
795
796 <varlistentry>
797 <term><command>reenable [NAME...]</command></term>
798
799 <listitem><para>Reenable one or more
800 unit files, as specified on the
801 command line. This is a combination of
802 <command>disable</command> and
803 <command>enable</command> and is
804 useful to reset the symlinks a unit is
805 enabled with to the defaults
806 configured in the
807 <literal>[Install]</literal> section
808 of the unit file.</para>
809 </listitem>
810 </varlistentry>
811
812 <varlistentry>
813 <term><command>preset [NAME...]</command></term>
814
815 <listitem><para>Reset one or more unit
816 files, as specified on the command
817 line, to the defaults configured in a
818 preset file. This has the same effect
819 as <command>disable</command> or
820 <command>enable</command>, depending
821 how the unit is listed in the preset
822 files.</para>
823 </listitem>
824 </varlistentry>
825
826 <varlistentry>
827 <term><command>mask [NAME...]</command></term>
828
829 <listitem><para>Mask one or more unit
830 files, as specified on the command
831 line. This will link these units to
832 <filename>/dev/null</filename>, making
833 it impossible to start them. This is a stronger version
834 of <command>disable</command>, since
835 it prohibits all kinds of activation
836 of the unit, including manual
837 activation. Use this option with
838 care.</para>
839 </listitem>
840 </varlistentry>
841
842 <varlistentry>
843 <term><command>unmask [NAME...]</command></term>
844
845 <listitem><para>Unmask one or more
846 unit files, as specified on the
847 command line. This will undo the
848 effect of
849 <command>mask</command>.</para>
850 </listitem>
851 </varlistentry>
852
853 <varlistentry>
854 <term><command>link [NAME...]</command></term>
855
856 <listitem><para>Link a unit file that
857 is not in the unit file search paths
858 into the unit file search path. This
859 requires an absolute path to a unit
860 file. The effect of this can be undone
861 with <command>disable</command>. The
862 effect of this command is that a unit
863 file is available for
864 <command>start</command> and other
865 commands although it isn't installed
866 directly in the unit search
867 path.</para>
868 </listitem>
ee5762e3
LP
869 </varlistentry>
870
393a2f9b
LP
871 <varlistentry>
872 <term><command>load [NAME...]</command></term>
873
874 <listitem><para>Load one or more units
875 specified on the command line. This
876 will simply load their configuration
877 from disk, but not start them. To
878 start them you need to use the
879 <command>start</command> command which
880 will implicitly load a unit that has
881 not been loaded yet. Note that systemd
882 garbage collects loaded units that are
883 not active or referenced by an active
884 unit. This means that units loaded
885 this way will usually not stay loaded
886 for long. Also note that this command
887 cannot be used to reload unit
888 configuration. Use the
889 <command>daemon-reload</command>
890 command for that. All in all, this
891 command is of little use except for
892 debugging.</para>
893 <para>This command should not be
894 confused with the
895 <command>daemon-reload</command> or
896 <command>reload</command>
897 commands.</para></listitem>
898 </varlistentry>
899 <varlistentry>
900 <term><command>list-jobs</command></term>
901
902 <listitem><para>List jobs that are in progress.</para></listitem>
903 </varlistentry>
904 <varlistentry>
905 <term><command>cancel [JOB...]</command></term>
906
907 <listitem><para>Cancel one or more
908 jobs specified on the command line by
909 their numeric job
3d428115 910 IDs. If no job id is specified, cancel all pending jobs.</para></listitem>
393a2f9b 911 </varlistentry>
7874bcd6
LP
912 <varlistentry>
913 <term><command>dump</command></term>
914
915 <listitem><para>Dump server
916 status. This will output a (usually
917 very long) human readable manager
918 status dump. Its format is subject to
919 change without notice and should not
920 be parsed by
921 applications.</para></listitem>
922 </varlistentry>
4445a875
LP
923 <varlistentry>
924 <term><command>dot</command></term>
925
926 <listitem><para>Generate textual
927 dependency graph description in dot
928 format for further processing with the
929 GraphViz
930 <citerefentry><refentrytitle>dot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
931 tool. Use a command line like
932 <command>systemctl dot | dot -Tsvg >
933 systemd.svg</command> to generate a
934 graphical dependency tree. Unless
935 <option>--order</option> or
936 <option>--require</option> is passed
937 the generated graph will show both
938 ordering and requirement
939 dependencies.</para></listitem>
940 </varlistentry>
7874bcd6
LP
941 <varlistentry>
942 <term><command>snapshot [NAME]</command></term>
943
944 <listitem><para>Create a snapshot. If
af62c704 945 a snapshot name is specified, the new
7874bcd6
LP
946 snapshot will be named after it. If
947 none is specified an automatic
948 snapshot name is generated. In either
7594fb25
LP
949 case, the snapshot name used is
950 printed to STDOUT, unless
951 <option>--quiet</option> is
952 specified.</para>
7874bcd6
LP
953
954 <para>A snapshot refers to a saved
955 state of the systemd manager. It is
3d428115 956 implemented itself as a unit that is
7874bcd6
LP
957 generated dynamically with this
958 command and has dependencies on all
959 units active at the time. At a later
960 time the user may return to this state
961 by using the
962 <command>isolate</command> command on
963 the snapshot unit.</para></listitem>
964
965 <para>Snapshots are only useful for
966 saving and restoring which units are
967 running or are stopped, they do not
968 save/restore any other
969 state. Snapshots are dynamic and lost
970 on reboot.</para>
971 </varlistentry>
972 <varlistentry>
6759e7a7
LP
973 <term><command>delete [NAME...]</command></term>
974
975 <listitem><para>Remove a snapshot
976 previously created with
977 <command>snapshot</command>.</para></listitem>
978 </varlistentry>
979 <varlistentry>
7874bcd6
LP
980 <term><command>daemon-reload</command></term>
981
982 <listitem><para>Reload systemd manager
983 configuration. This will reload all
984 unit files and recreate the entire
985 dependency tree. While the daemon is
af62c704 986 reloaded, all sockets systemd listens
ad678a06 987 on on behalf of user configuration will
7874bcd6
LP
988 stay accessible.</para> <para>This
989 command should not be confused with
990 the <command>load</command> or
991 <command>reload</command>
992 commands.</para></listitem>
993 </varlistentry>
994 <varlistentry>
995 <term><command>daemon-reexec</command></term>
996
997 <listitem><para>Reexecute the systemd
998 manager. This will serialize the
999 manager state, reexecute the process
1000 and deserialize the state again. This
1001 command is of little use except for
1002 debugging and package
1003 upgrades. Sometimes it might be
1004 helpful as a heavy-weight
1005 <command>daemon-reload</command>. While
1006 the daemon is reexecuted all sockets
1007 systemd listens on on behalf of user
1008 configuration will stay
1009 accessible.</para></listitem>
1010 </varlistentry>
7874bcd6
LP
1011 <varlistentry>
1012 <term><command>show-environment</command></term>
1013
1014 <listitem><para>Dump the systemd
1015 manager environment block. The
1016 environment block will be dumped in
1017 straight-forward form suitable for
1018 sourcing into a shell script. This
1019 environment block will be passed to
1020 all processes the manager
1021 spawns.</para></listitem>
1022 </varlistentry>
1023 <varlistentry>
1024 <term><command>set-environment [NAME=VALUE...]</command></term>
1025
1026 <listitem><para>Set one or more
1027 systemd manager environment variables,
1028 as specified on the command
1029 line.</para></listitem>
1030 </varlistentry>
1031 <varlistentry>
1032 <term><command>unset-environment [NAME...]</command></term>
1033
1034 <listitem><para>Unset one or more
1035 systemd manager environment
1036 variables. If only a variable name is
1037 specified it will be removed
1038 regardless of its value. If a variable
1039 and a value are specified the variable
1040 is only removed if it has the
1041 specified value.</para></listitem>
1042 </varlistentry>
59cddb23
LP
1043 <varlistentry>
1044 <term><command>default</command></term>
1045
1046 <listitem><para>Enter default
1047 mode. This is mostly equivalent to
1048 <command>start
1049 default.target</command>.</para></listitem>
1050 </varlistentry>
1051 <varlistentry>
1052 <term><command>rescue</command></term>
1053
1054 <listitem><para>Enter rescue
1055 mode. This is mostly equivalent to
1056 <command>isolate
1057 rescue.target</command> but also
1058 prints a wall message to all
1059 users.</para></listitem>
1060 </varlistentry>
1061 <varlistentry>
1062 <term><command>emergency</command></term>
7874bcd6 1063
59cddb23
LP
1064 <listitem><para>Enter emergency
1065 mode. This is mostly equivalent to
1066 <command>isolate
1067 emergency.target</command> but also
1068 prints a wall message to all
1069 users.</para></listitem>
1070 </varlistentry>
7874bcd6
LP
1071 <varlistentry>
1072 <term><command>halt</command></term>
1073
1074 <listitem><para>Shut down and halt the
1075 system. This is mostly equivalent to
1076 <command>start halt.target</command>
1077 but also prints a wall message to all
e606bb61
LP
1078 users. If combined with
1079 <option>--force</option> shutdown of
1080 all running services is skipped,
1081 however all processes are killed and
1082 all file systems are unmounted or
59cddb23 1083 mounted read-only, immediately
e606bb61
LP
1084 followed by the system halt. If
1085 <option>--force</option> is specified
1086 twice the the operation is immediately
1087 executed without terminating any
1088 processes or unmounting any file
1089 systems. This may result in data
1090 loss.</para></listitem>
7874bcd6
LP
1091 </varlistentry>
1092 <varlistentry>
1093 <term><command>poweroff</command></term>
1094
1095 <listitem><para>Shut down and
1096 power-off the system. This is mostly
1097 equivalent to <command>start
1098 poweroff.target</command> but also
e606bb61 1099 prints a wall message to all users. If
59cddb23
LP
1100 combined with <option>--force</option>
1101 shutdown of all running services is
e606bb61
LP
1102 skipped, however all processes are
1103 killed and all file systems are
1104 unmounted or mounted read-only,
1105 immediately followed by the powering
1106 off. If <option>--force</option> is
1107 specified twice the the operation is
1108 immediately executed without
1109 terminating any processes or
1110 unmounting any file systems. This may
1111 result in data loss.</para></listitem>
7874bcd6
LP
1112 </varlistentry>
1113 <varlistentry>
1114 <term><command>reboot</command></term>
1115
e606bb61
LP
1116 <listitem><para>Shut down and reboot
1117 the system. This is mostly equivalent
1118 to <command>start
7874bcd6 1119 reboot.target</command> but also
e606bb61 1120 prints a wall message to all users. If
59cddb23
LP
1121 combined with <option>--force</option>
1122 shutdown of all running services is
e606bb61
LP
1123 skipped, however all processes are
1124 killed and all file systems are
1125 unmounted or mounted read-only,
1126 immediately followed by the reboot. If
1127 <option>--force</option> is specified
1128 twice the the operation is immediately
1129 executed without terminating any
1130 processes or unmounting any file
1131 systems. This may result in data
1132 loss.</para></listitem>
7874bcd6
LP
1133 </varlistentry>
1134 <varlistentry>
59cddb23 1135 <term><command>kexec</command></term>
7874bcd6 1136
59cddb23
LP
1137 <listitem><para>Shut down and reboot
1138 the system via kexec. This is mostly
1139 equivalent to <command>start
1140 kexec.target</command> but also prints
1141 a wall message to all users. If
1142 combined with <option>--force</option>
1143 shutdown of all running services is
3d428115
RB
1144 skipped, however all processes are killed
1145 and all file systems are unmounted or
59cddb23
LP
1146 mounted read-only, immediately
1147 followed by the
1148 reboot.</para></listitem>
7874bcd6
LP
1149 </varlistentry>
1150 <varlistentry>
59cddb23 1151 <term><command>exit</command></term>
7874bcd6 1152
59cddb23
LP
1153 <listitem><para>Ask the systemd
1154 manager to quit. This is only
af2d49f7 1155 supported for user service managers
59cddb23 1156 (i.e. in conjunction with the
af2d49f7 1157 <option>--user</option> option) and
59cddb23 1158 will fail otherwise.</para></listitem>
7874bcd6 1159 </varlistentry>
6edd7d0a
LP
1160 <varlistentry>
1161 <term><command>suspend</command></term>
1162
1163 <listitem><para>Suspend the system.</para></listitem>
1164 </varlistentry>
1165 <varlistentry>
1166 <term><command>hibernate</command></term>
1167
1168 <listitem><para>Hibernate the system.</para></listitem>
1169 </varlistentry>
957eb8ca
LP
1170 <varlistentry>
1171 <term><command>switch-root [ROOT] [INIT]</command></term>
1172
1173 <listitem><para>Switches to a
1174 different root directory and executes
1175 a new system manager process below
1176 it. This is intended for usage in
1177 initial RAM disks ("initrd"), and will
1178 transition from the initrd's system
1179 manager process (a.k.a "init" process)
1180 to the main system manager
1181 process. Takes two arguments: the
1182 directory to make the new root
1183 directory, and the path to the new
1184 system manager binary below it to
1185 execute as PID 1. If the latter is
1186 ommitted or the empty string, a
1187 systemd binary will automatically be
1188 searched for and used as init. If the
1189 system manager path is ommitted or
1190 equal the empty string the state of
1191 the initrd's system manager process is
1192 passed to the main system manager,
1193 which allows later introspection of the
1194 state of the services involved in the
1195 initrd boot.</para></listitem>
1196 </varlistentry>
7874bcd6
LP
1197 </variablelist>
1198
1199 </refsect1>
1200
1201 <refsect1>
1202 <title>Exit status</title>
1203
1204 <para>On success 0 is returned, a non-zero failure
1205 code otherwise.</para>
1206 </refsect1>
1207
abebb5af
VS
1208 <refsect1>
1209 <title>Environment</title>
1210
1211 <variablelist>
1212 <varlistentry>
1213 <term><varname>$SYSTEMD_PAGER</varname></term>
1214 <listitem><para>Pager to use when
1215 <option>--no-pager</option> is not given;
1216 overrides <varname>$PAGER</varname>. Setting
1217 this to an empty string or the value
1218 <literal>cat</literal> is equivalent to passing
1219 <option>--no-pager</option>.</para></listitem>
1220 </varlistentry>
1221 </variablelist>
1222 </refsect1>
1223
7874bcd6
LP
1224 <refsect1>
1225 <title>See Also</title>
1226 <para>
1227 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1228 <citerefentry><refentrytitle>systemadm</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
169c4f65
LP
1229 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1230 <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
7874bcd6
LP
1231 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1232 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1233 <citerefentry><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1234 </para>
1235 </refsect1>
1236
1237</refentry>