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