chiark / gitweb /
760115acb55444789b12f804fdddaf45d638439c
[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 (subject to limitations
475                                 specified with <option>-t</option>).</para>
476
477                                 <para>This is the default command.</para></listitem>
478                         </varlistentry>
479                         <varlistentry>
480                                 <term><command>start [NAME...]</command></term>
481
482                                 <listitem><para>Start (activate) one
483                                 or more units specified on the command
484                                 line.</para></listitem>
485                         </varlistentry>
486                         <varlistentry>
487                                 <term><command>stop [NAME...]</command></term>
488
489                                 <listitem><para>Stop (deactivate) one
490                                 or more units specified on the command
491                                 line.</para></listitem>
492                         </varlistentry>
493                         <varlistentry>
494                                 <term><command>reload [NAME...]</command></term>
495
496                                 <listitem><para>Asks all units listed
497                                 on the command line to reload their
498                                 configuration. Note that this will
499                                 reload the service-specific
500                                 configuration, not the unit
501                                 configuration file of systemd. If you
502                                 want systemd to reload the
503                                 configuration file of a unit use the
504                                 <command>daemon-reload</command>
505                                 command. In other words: for the
506                                 example case of Apache, this will
507                                 reload Apache's
508                                 <filename>httpd.conf</filename> in the
509                                 web server, not the
510                                 <filename>apache.service</filename>
511                                 systemd unit file. </para>
512
513                                 <para>This command should not be
514                                 confused with the
515                                 <command>daemon-reload</command> or
516                                 <command>load</command>
517                                 commands.</para></listitem>
518
519                         </varlistentry>
520                         <varlistentry>
521                                 <term><command>restart [NAME...]</command></term>
522
523                                 <listitem><para>Restart one or more
524                                 units specified on the command
525                                 line. If the units are not running yet
526                                 they will be
527                                 started.</para></listitem>
528                         </varlistentry>
529                         <varlistentry>
530                                 <term><command>try-restart [NAME...]</command></term>
531
532                                 <listitem><para>Restart one or more
533                                 units specified on the command
534                                 line if the units are running. Do
535                                 nothing if units are not running.
536                                 Note that for compatibility
537                                 with Red Hat init scripts
538                                 <command>condrestart</command> is
539                                 equivalent to this command.</para></listitem>
540                         </varlistentry>
541                         <varlistentry>
542                                 <term><command>reload-or-restart [NAME...]</command></term>
543
544                                 <listitem><para>Reload one or more
545                                 units if they support it. If not,
546                                 restart them instead. If the units
547                                 are not running yet they will be
548                                 started.</para></listitem>
549                         </varlistentry>
550                         <varlistentry>
551                                 <term><command>reload-or-try-restart [NAME...]</command></term>
552
553                                 <listitem><para>Reload one or more
554                                 units if they support it. If not,
555                                 restart them instead. Do nothing if
556                                 the units are not running. Note that
557                                 for compatibility with SysV init
558                                 scripts
559                                 <command>force-reload</command> is
560                                 equivalent to this
561                                 command.</para></listitem>
562                         </varlistentry>
563                         <varlistentry>
564                                 <term><command>isolate [NAME]</command></term>
565
566                                 <listitem><para>Start the unit
567                                 specified on the command line and its
568                                 dependencies and stop all others.</para>
569
570                                 <para>This is similar to changing the
571                                 runlevel in a traditional init system. The
572                                 <command>isolate</command> command will
573                                 immediately stop processes that are not
574                                 enabled in the new unit, possibly including
575                                 the graphical environment or terminal you
576                                 are currently using.</para>
577
578                                 <para>Note that this works only on units
579                                 where <option>AllowIsolate=</option> is
580                                 enabled. See
581                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
582                                 for details.</para></listitem>
583                         </varlistentry>
584                         <varlistentry>
585                                 <term><command>kill [NAME...]</command></term>
586
587                                 <listitem><para>Send a signal to one
588                                 or more processes of the unit. Use
589                                 <option>--kill-who=</option> to select
590                                 which process to kill. Use
591                                 <option>--kill-mode=</option> to
592                                 select the kill mode and
593                                 <option>--signal=</option> to select
594                                 the signal to send.</para></listitem>
595                         </varlistentry>
596                         <varlistentry>
597                                 <term><command>is-active [NAME...]</command></term>
598
599                                 <listitem><para>Check whether any of
600                                 the specified units are active
601                                 (i.e. running). Returns an exit code
602                                 0 if at least one is active, non-zero
603                                 otherwise. Unless
604                                 <option>--quiet</option> is specified
605                                 this will also print the current unit
606                                 state to STDOUT.</para></listitem>
607                         </varlistentry>
608                         <varlistentry>
609                                 <term><command>is-failed [NAME...]</command></term>
610
611                                 <listitem><para>Check whether any of
612                                 the specified units are failed.
613                                 Returns an exit code
614                                 0 if at least one is failed, non-zero
615                                 otherwise. Unless
616                                 <option>--quiet</option> is specified
617                                 this will also print the current unit
618                                 state to STDOUT.</para></listitem>
619                         </varlistentry>
620                         <varlistentry>
621                                 <term><command>status [NAME...|PID...]</command></term>
622
623                                 <listitem><para>Show terse runtime
624                                 status information about one or more
625                                 units, followed by most recent log
626                                 data from the journal. If no units are
627                                 specified, show all units (subject to
628                                 limitations specified with
629                                 <option>-t</option>). If a PID is
630                                 passed show information about the unit
631                                 the process belongs to.</para>
632
633                                 <para>This function is intended to
634                                 generate human-readable output. If you
635                                 are looking for computer-parsable
636                                 output, use <command>show</command>
637                                 instead.</para></listitem>
638                         </varlistentry>
639                         <varlistentry>
640                                 <term><command>show [NAME...|JOB...]</command></term>
641
642                                 <listitem><para>Show properties of one
643                                 or more units, jobs or the manager
644                                 itself. If no argument is specified
645                                 properties of the manager will be
646                                 shown. If a unit name is specified
647                                 properties of the unit is shown, and
648                                 if a job id is specified properties of
649                                 the job is shown. By default, empty
650                                 properties are suppressed. Use
651                                 <option>--all</option> to show those
652                                 too. To select specific properties to
653                                 show use
654                                 <option>--property=</option>. This
655                                 command is intended to be used
656                                 whenever computer-parsable output is
657                                 required. Use
658                                 <command>status</command> if you are
659                                 looking for formatted human-readable
660                                 output.</para></listitem>
661                         </varlistentry>
662                         <varlistentry>
663                                 <term><command>help [NAME...|PID...]</command></term>
664
665                                 <listitem><para>Show manual pages for
666                                 one or more units, if available. If a
667                                 PID is passed the manual pages for the
668                                 unit the process of the PID belongs to
669                                 is shown.</para></listitem>
670                         </varlistentry>
671                         <varlistentry>
672                                 <term><command>reset-failed [NAME...]</command></term>
673
674                                 <listitem><para>Reset the
675                                 '<literal>failed</literal>' state of the
676                                 specified units, or if no unit name is
677                                 passed of all units. When a unit fails
678                                 in some way (i.e. process exiting with
679                                 non-zero error code, terminating
680                                 abnormally or timing out) it will
681                                 automatically enter the
682                                 '<literal>failed</literal>' state and
683                                 its exit code and status is recorded
684                                 for introspection by the administrator
685                                 until the service is restarted or
686                                 reset with this
687                                 command.</para></listitem>
688                         </varlistentry>
689
690                         <varlistentry>
691                                 <term><command>list-unit-files</command></term>
692
693                                 <listitem><para>List installed unit files.
694                                 </para></listitem>
695                         </varlistentry>
696
697                         <varlistentry>
698                                 <term><command>enable [NAME...]</command></term>
699
700                                 <listitem><para>Enable one or
701                                 more unit files or unit file
702                                 instances, as specified on the
703                                 command line. This will create a
704                                 number of symlinks as encoded in
705                                 the <literal>[Install]</literal>
706                                 sections of the unit files. After
707                                 the symlinks have been created the
708                                 systemd configuration is reloaded
709                                 (in a way that is equivalent to
710                                 <command>daemon-reload</command>)
711                                 to ensure the changes are taken into
712                                 account immediately. Note that this
713                                 does not have the effect that any of
714                                 the units enabled are also started at
715                                 the same time.  If this is desired
716                                 a separate <command>start</command>
717                                 command must be invoked for the unit.
718                                 Also note that in case of instance
719                                 enablement, symlinks named same as
720                                 instances are created in install
721                                 location, however they all point to
722                                 the same template unit file.</para>
723
724                                 <para>This command will
725                                 print the actions executed. This
726                                 output may be suppressed by passing
727                                 <option>--quiet</option>.</para>
728
729                                 <para>Note that this operation creates
730                                 only the suggested symlinks for the
731                                 units. While this command is the
732                                 recommended way to manipulate the unit
733                                 configuration directory, the
734                                 administrator is free to make
735                                 additional changes manually, by
736                                 placing or removing symlinks in the
737                                 directory. This is particularly useful
738                                 to create configurations that deviate
739                                 from the suggested default
740                                 installation. In this case the
741                                 administrator must make sure to invoke
742                                 <command>daemon-reload</command>
743                                 manually as necessary, to ensure his
744                                 changes are taken into account.</para>
745
746                                 <para>Enabling units should not be
747                                 confused with starting (activating)
748                                 units, as done by the
749                                 <command>start</command>
750                                 command. Enabling and starting units
751                                 is orthogonal: units may be enabled
752                                 without being started and started
753                                 without being enabled. Enabling simply
754                                 hooks the unit into various suggested
755                                 places (for example, so that the unit
756                                 is automatically started on boot or
757                                 when a particular kind of hardware is
758                                 plugged in). Starting actually spawns
759                                 the daemon process (in case of service
760                                 units), or binds the socket (in case
761                                 of socket units), and so
762                                 on.</para>
763
764                                 <para>Depending on whether
765                                 <option>--system</option>,
766                                 <option>--user</option> or
767                                 <option>--global</option> is specified
768                                 this enables the unit for the system,
769                                 for the calling user only
770                                 or for all future logins of all
771                                 users. Note that in the latter case no
772                                 systemd daemon configuration is
773                                 reloaded.</para>
774                                 </listitem>
775                         </varlistentry>
776
777                         <varlistentry>
778                                 <term><command>disable [NAME...]</command></term>
779
780                                 <listitem><para>Disables one or more
781                                 units. This removes all symlinks to
782                                 the specified unit files from the unit
783                                 configuration directory, and hence
784                                 undoes the changes made by
785                                 <command>enable</command>. Note
786                                 however that this removes
787                                 all symlinks to the unit files
788                                 (i.e. including manual additions), not
789                                 just those actually created by
790                                 <command>enable</command>. This call
791                                 implicitly reloads the systemd daemon
792                                 configuration after completing the
793                                 disabling of the units. Note that this
794                                 command does not implicitly stop the
795                                 units that are being disabled. If this
796                                 is desired an additional
797                                 <command>stop</command> command should
798                                 be executed afterwards.</para>
799
800                                 <para>This command will print the
801                                 actions executed. This output may be
802                                 suppressed by passing
803                                 <option>--quiet</option>.</para>
804                                 </listitem>
805
806                                 <para>This command honors
807                                 <option>--system</option>,
808                                 <option>--user</option>,
809                                 <option>--global</option> in a similar
810                                 way as
811                                 <command>enable</command>.</para>
812                         </varlistentry>
813
814                         <varlistentry>
815                                 <term><command>is-enabled [NAME...]</command></term>
816
817                                 <listitem><para>Checks whether any of
818                                 the specified unit files are enabled
819                                 (as with
820                                 <command>enable</command>). Returns an
821                                 exit code of 0 if at least one is
822                                 enabled, non-zero otherwise. Prints
823                                 the current enable status. To suppress
824                                 this output use
825                                 <option>--quiet</option>.</para></listitem>
826                         </varlistentry>
827
828                         <varlistentry>
829                                 <term><command>reenable [NAME...]</command></term>
830
831                                 <listitem><para>Reenable one or more
832                                 unit files, as specified on the
833                                 command line. This is a combination of
834                                 <command>disable</command> and
835                                 <command>enable</command> and is
836                                 useful to reset the symlinks a unit is
837                                 enabled with to the defaults
838                                 configured in the
839                                 <literal>[Install]</literal> section
840                                 of the unit file.</para>
841                                 </listitem>
842                         </varlistentry>
843
844                         <varlistentry>
845                                 <term><command>preset [NAME...]</command></term>
846
847                                 <listitem><para>Reset one or more unit
848                                 files, as specified on the command
849                                 line, to the defaults configured in
850                                 the preset policy files. This has the
851                                 same effect as
852                                 <command>disable</command> or
853                                 <command>enable</command>, depending
854                                 how the unit is listed in the preset
855                                 files. For more information on preset
856                                 policy format see
857                                 <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
858                                 more information on the concept of
859                                 presets please consult the <ulink
860                                 url="http://freedesktop.org/wiki/Software/systemd/Preset">Preset</ulink>
861                                 document.</para>
862                                 </listitem>
863                         </varlistentry>
864
865                         <varlistentry>
866                                 <term><command>mask [NAME...]</command></term>
867
868                                 <listitem><para>Mask one or more unit
869                                 files, as specified on the command
870                                 line. This will link these units to
871                                 <filename>/dev/null</filename>, making
872                                 it impossible to start them. This is a stronger version
873                                 of <command>disable</command>, since
874                                 it prohibits all kinds of activation
875                                 of the unit, including manual
876                                 activation. Use this option with
877                                 care.</para>
878                                 </listitem>
879                         </varlistentry>
880
881                         <varlistentry>
882                                 <term><command>unmask [NAME...]</command></term>
883
884                                 <listitem><para>Unmask one or more
885                                 unit files, as specified on the
886                                 command line. This will undo the
887                                 effect of
888                                 <command>mask</command>.</para>
889                                 </listitem>
890                         </varlistentry>
891
892                         <varlistentry>
893                                 <term><command>link [NAME...]</command></term>
894
895                                 <listitem><para>Link a unit file that
896                                 is not in the unit file search paths
897                                 into the unit file search path. This
898                                 requires an absolute path to a unit
899                                 file. The effect of this can be undone
900                                 with <command>disable</command>. The
901                                 effect of this command is that a unit
902                                 file is available for
903                                 <command>start</command> and other
904                                 commands although it isn't installed
905                                 directly in the unit search
906                                 path.</para>
907                                 </listitem>
908                         </varlistentry>
909
910                         <varlistentry>
911                                 <term><command>load [NAME...]</command></term>
912
913                                 <listitem><para>Load one or more units
914                                 specified on the command line. This
915                                 will simply load their configuration
916                                 from disk, but not start them. To
917                                 start them you need to use the
918                                 <command>start</command> command which
919                                 will implicitly load a unit that has
920                                 not been loaded yet. Note that systemd
921                                 garbage collects loaded units that are
922                                 not active or referenced by an active
923                                 unit. This means that units loaded
924                                 this way will usually not stay loaded
925                                 for long. Also note that this command
926                                 cannot be used to reload unit
927                                 configuration. Use the
928                                 <command>daemon-reload</command>
929                                 command for that. All in all, this
930                                 command is of little use except for
931                                 debugging.</para>
932                                 <para>This command should not be
933                                 confused with the
934                                 <command>daemon-reload</command> or
935                                 <command>reload</command>
936                                 commands.</para></listitem>
937                         </varlistentry>
938                         <varlistentry>
939                                 <term><command>list-jobs</command></term>
940
941                                 <listitem><para>List jobs that are in progress.</para></listitem>
942                         </varlistentry>
943                         <varlistentry>
944                                 <term><command>cancel [JOB...]</command></term>
945
946                                 <listitem><para>Cancel one or more
947                                 jobs specified on the command line by
948                                 their numeric job
949                                 IDs. If no job id is specified, cancel all pending jobs.</para></listitem>
950                         </varlistentry>
951                         <varlistentry>
952                                 <term><command>dump</command></term>
953
954                                 <listitem><para>Dump server
955                                 status. This will output a (usually
956                                 very long) human readable manager
957                                 status dump. Its format is subject to
958                                 change without notice and should not
959                                 be parsed by
960                                 applications.</para></listitem>
961                         </varlistentry>
962                         <varlistentry>
963                                 <term><command>list-dependencies [NAME]</command></term>
964
965                                 <listitem><para> Shows required and
966                                 wanted units of the specified unit. If
967                                 no unit is specified
968                                 <filename>default.target</filename> is
969                                 implied. Target units are recursively
970                                 expanded.  When <option>--all</option>
971                                 is passed all other units aare
972                                 recursively expanded as well.</para>
973                                 </listitem>
974                         </varlistentry>
975                         <varlistentry>
976                                 <term><command>snapshot [NAME]</command></term>
977
978                                 <listitem><para>Create a snapshot. If
979                                 a snapshot name is specified, the new
980                                 snapshot will be named after it. If
981                                 none is specified an automatic
982                                 snapshot name is generated. In either
983                                 case, the snapshot name used is
984                                 printed to STDOUT, unless
985                                 <option>--quiet</option> is
986                                 specified.</para>
987
988                                 <para>A snapshot refers to a saved
989                                 state of the systemd manager. It is
990                                 implemented itself as a unit that is
991                                 generated dynamically with this
992                                 command and has dependencies on all
993                                 units active at the time. At a later
994                                 time the user may return to this state
995                                 by using the
996                                 <command>isolate</command> command on
997                                 the snapshot unit.</para></listitem>
998
999                                 <para>Snapshots are only useful for
1000                                 saving and restoring which units are
1001                                 running or are stopped, they do not
1002                                 save/restore any other
1003                                 state. Snapshots are dynamic and lost
1004                                 on reboot.</para>
1005                         </varlistentry>
1006                         <varlistentry>
1007                                 <term><command>delete [NAME...]</command></term>
1008
1009                                 <listitem><para>Remove a snapshot
1010                                 previously created with
1011                                 <command>snapshot</command>.</para></listitem>
1012                         </varlistentry>
1013                         <varlistentry>
1014                                 <term><command>daemon-reload</command></term>
1015
1016                                 <listitem><para>Reload systemd manager
1017                                 configuration. This will reload all
1018                                 unit files and recreate the entire
1019                                 dependency tree. While the daemon is
1020                                 reloaded, all sockets systemd listens
1021                                 on on behalf of user configuration will
1022                                 stay accessible.</para> <para>This
1023                                 command should not be confused with
1024                                 the <command>load</command> or
1025                                 <command>reload</command>
1026                                 commands.</para></listitem>
1027                         </varlistentry>
1028                         <varlistentry>
1029                                 <term><command>daemon-reexec</command></term>
1030
1031                                 <listitem><para>Reexecute the systemd
1032                                 manager. This will serialize the
1033                                 manager state, reexecute the process
1034                                 and deserialize the state again. This
1035                                 command is of little use except for
1036                                 debugging and package
1037                                 upgrades. Sometimes it might be
1038                                 helpful as a heavy-weight
1039                                 <command>daemon-reload</command>. While
1040                                 the daemon is reexecuted all sockets
1041                                 systemd listens on on behalf of user
1042                                 configuration will stay
1043                                 accessible.</para></listitem>
1044                         </varlistentry>
1045                         <varlistentry>
1046                                 <term><command>show-environment</command></term>
1047
1048                                 <listitem><para>Dump the systemd
1049                                 manager environment block. The
1050                                 environment block will be dumped in
1051                                 straight-forward form suitable for
1052                                 sourcing into a shell script. This
1053                                 environment block will be passed to
1054                                 all processes the manager
1055                                 spawns.</para></listitem>
1056                         </varlistentry>
1057                         <varlistentry>
1058                                 <term><command>set-environment [NAME=VALUE...]</command></term>
1059
1060                                 <listitem><para>Set one or more
1061                                 systemd manager environment variables,
1062                                 as specified on the command
1063                                 line.</para></listitem>
1064                         </varlistentry>
1065                         <varlistentry>
1066                                 <term><command>unset-environment [NAME...]</command></term>
1067
1068                                 <listitem><para>Unset one or more
1069                                 systemd manager environment
1070                                 variables. If only a variable name is
1071                                 specified it will be removed
1072                                 regardless of its value. If a variable
1073                                 and a value are specified the variable
1074                                 is only removed if it has the
1075                                 specified value.</para></listitem>
1076                         </varlistentry>
1077                         <varlistentry>
1078                                 <term><command>default</command></term>
1079
1080                                 <listitem><para>Enter default
1081                                 mode. This is mostly equivalent to
1082                                 <command>start
1083                                 default.target</command>.</para></listitem>
1084                         </varlistentry>
1085                         <varlistentry>
1086                                 <term><command>rescue</command></term>
1087
1088                                 <listitem><para>Enter rescue
1089                                 mode. This is mostly equivalent to
1090                                 <command>isolate
1091                                 rescue.target</command> but also
1092                                 prints a wall message to all
1093                                 users.</para></listitem>
1094                         </varlistentry>
1095                         <varlistentry>
1096                                 <term><command>emergency</command></term>
1097
1098                                 <listitem><para>Enter emergency
1099                                 mode. This is mostly equivalent to
1100                                 <command>isolate
1101                                 emergency.target</command> but also
1102                                 prints a wall message to all
1103                                 users.</para></listitem>
1104                         </varlistentry>
1105                         <varlistentry>
1106                                 <term><command>halt</command></term>
1107
1108                                 <listitem><para>Shut down and halt the
1109                                 system. This is mostly equivalent to
1110                                 <command>start halt.target</command>
1111                                 but also prints a wall message to all
1112                                 users.  If combined with
1113                                 <option>--force</option> shutdown of
1114                                 all running services is skipped,
1115                                 however all processes are killed and
1116                                 all file systems are unmounted or
1117                                 mounted read-only, immediately
1118                                 followed by the system halt.  If
1119                                 <option>--force</option> is specified
1120                                 twice the operation is immediately
1121                                 executed without terminating any
1122                                 processes or unmounting any file
1123                                 systems. This may result in data
1124                                 loss.</para></listitem>
1125                         </varlistentry>
1126                         <varlistentry>
1127                                 <term><command>poweroff</command></term>
1128
1129                                 <listitem><para>Shut down and
1130                                 power-off the system. This is mostly
1131                                 equivalent to <command>start
1132                                 poweroff.target</command> but also
1133                                 prints a wall message to all users. If
1134                                 combined with <option>--force</option>
1135                                 shutdown of all running services is
1136                                 skipped, however all processes are
1137                                 killed and all file systems are
1138                                 unmounted or mounted read-only,
1139                                 immediately followed by the powering
1140                                 off. If <option>--force</option> is
1141                                 specified twice the operation is
1142                                 immediately executed without
1143                                 terminating any processes or
1144                                 unmounting any file systems. This may
1145                                 result in data loss.</para></listitem>
1146                         </varlistentry>
1147                         <varlistentry>
1148                                 <term><command>reboot</command></term>
1149
1150                                 <listitem><para>Shut down and reboot
1151                                 the system. This is mostly equivalent
1152                                 to <command>start
1153                                 reboot.target</command> but also
1154                                 prints a wall message to all users. If
1155                                 combined with <option>--force</option>
1156                                 shutdown of all running services is
1157                                 skipped, however all processes are
1158                                 killed and all file systems are
1159                                 unmounted or mounted read-only,
1160                                 immediately followed by the reboot. If
1161                                 <option>--force</option> is specified
1162                                 twice the operation is immediately
1163                                 executed without terminating any
1164                                 processes or unmounting any file
1165                                 systems. This may result in data
1166                                 loss.</para></listitem>
1167                         </varlistentry>
1168                         <varlistentry>
1169                                 <term><command>kexec</command></term>
1170
1171                                 <listitem><para>Shut down and reboot
1172                                 the system via kexec. This is mostly
1173                                 equivalent to <command>start
1174                                 kexec.target</command> but also prints
1175                                 a wall message to all users. If
1176                                 combined with <option>--force</option>
1177                                 shutdown of all running services is
1178                                 skipped, however all processes are killed
1179                                 and all file systems are unmounted or
1180                                 mounted read-only, immediately
1181                                 followed by the
1182                                 reboot.</para></listitem>
1183                         </varlistentry>
1184                         <varlistentry>
1185                                 <term><command>exit</command></term>
1186
1187                                 <listitem><para>Ask the systemd
1188                                 manager to quit. This is only
1189                                 supported for user service managers
1190                                 (i.e. in conjunction with the
1191                                 <option>--user</option> option) and
1192                                 will fail otherwise.</para></listitem>
1193                         </varlistentry>
1194                         <varlistentry>
1195                                 <term><command>suspend</command></term>
1196
1197                                 <listitem><para>Suspend the
1198                                 system. This will trigger activation
1199                                 of the special
1200                                 <filename>suspend.target</filename>
1201                                 target.</para></listitem>
1202                         </varlistentry>
1203                         <varlistentry>
1204                                 <term><command>hibernate</command></term>
1205
1206                                 <listitem><para>Hibernate the
1207                                 system. This will trigger activation
1208                                 of the special
1209                                 <filename>hibernate.target</filename>
1210                                 target.</para></listitem>
1211                         </varlistentry>
1212                         <varlistentry>
1213                                 <term><command>hybrid-sleep</command></term>
1214
1215                                 <listitem><para>Hibernate and suspend
1216                                 the system. This will trigger
1217                                 activation of the special
1218                                 <filename>hybrid-sleep.target</filename>
1219                                 target.</para></listitem>
1220                         </varlistentry>
1221                         <varlistentry>
1222                                 <term><command>switch-root [ROOT] [INIT]</command></term>
1223
1224                                 <listitem><para>Switches to a
1225                                 different root directory and executes
1226                                 a new system manager process below
1227                                 it. This is intended for usage in
1228                                 initial RAM disks ("initrd"), and will
1229                                 transition from the initrd's system
1230                                 manager process (a.k.a "init" process)
1231                                 to the main system manager
1232                                 process. Takes two arguments: the
1233                                 directory to make the new root
1234                                 directory, and the path to the new
1235                                 system manager binary below it to
1236                                 execute as PID 1. If the latter is
1237                                 omitted or the empty string, a
1238                                 systemd binary will automatically be
1239                                 searched for and used as init. If the
1240                                 system manager path is omitted or
1241                                 equal the empty string the state of
1242                                 the initrd's system manager process is
1243                                 passed to the main system manager,
1244                                 which allows later introspection of the
1245                                 state of the services involved in the
1246                                 initrd boot.</para></listitem>
1247                         </varlistentry>
1248                 </variablelist>
1249
1250         </refsect1>
1251
1252         <refsect1>
1253                 <title>Exit status</title>
1254
1255                 <para>On success 0 is returned, a non-zero failure
1256                 code otherwise.</para>
1257         </refsect1>
1258
1259         <refsect1>
1260                 <title>Environment</title>
1261
1262                 <variablelist class='environment-variables'>
1263                         <varlistentry>
1264                                 <term><varname>$SYSTEMD_PAGER</varname></term>
1265                                 <listitem><para>Pager to use when
1266                                 <option>--no-pager</option> is not given;
1267                                 overrides <varname>$PAGER</varname>.  Setting
1268                                 this to an empty string or the value
1269                                 <literal>cat</literal> is equivalent to passing
1270                                 <option>--no-pager</option>.</para></listitem>
1271                         </varlistentry>
1272                 </variablelist>
1273         </refsect1>
1274
1275         <refsect1>
1276                 <title>See Also</title>
1277                 <para>
1278                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1279                         <citerefentry><refentrytitle>systemadm</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1280                         <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1281                         <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1282                         <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1283                         <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1284                         <citerefentry><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1285                         <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1286                 </para>
1287         </refsect1>
1288
1289 </refentry>