1 <?xml version='
1.0'
?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 SPDX-License-Identifier: LGPL-2.1+
8 This file is part of systemd.
10 Copyright 2010 Lennart Poettering
13 <refentry id=
"systemd"
14 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
17 <title>systemd
</title>
18 <productname>systemd
</productname>
22 <contrib>Developer
</contrib>
23 <firstname>Lennart
</firstname>
24 <surname>Poettering
</surname>
25 <email>lennart@poettering.net
</email>
31 <refentrytitle>systemd
</refentrytitle>
32 <manvolnum>1</manvolnum>
36 <refname>systemd
</refname>
37 <refname>init
</refname>
38 <refpurpose>systemd system and service manager
</refpurpose>
43 <command>/usr/lib/systemd/systemd
</command>
44 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
47 <command>init
</command>
48 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
49 <arg choice=
"req">COMMAND
</arg>
54 <title>Description
</title>
56 <para>systemd is a system and service manager for Linux operating
57 systems. When run as first process on boot (as PID
1), it acts as
58 init system that brings up and maintains userspace
61 <para>For compatibility with SysV, if systemd is called as
62 <command>init
</command> and a PID that is not
1, it will execute
63 <command>telinit
</command> and pass all command line arguments
64 unmodified. That means
<command>init
</command> and
65 <command>telinit
</command> are mostly equivalent when invoked from
66 normal login sessions. See
67 <citerefentry><refentrytitle>telinit
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
68 for more information.
</para>
70 <para>When run as a system instance, systemd interprets the
71 configuration file
<filename>system.conf
</filename> and the files
72 in
<filename>system.conf.d
</filename> directories; when run as a
73 user instance, systemd interprets the configuration file
74 <filename>user.conf
</filename> and the files in
75 <filename>user.conf.d
</filename> directories. See
76 <citerefentry><refentrytitle>systemd-system.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
77 for more information.
</para>
81 <title>Options
</title>
83 <para>The following options are understood:
</para>
87 <term><option>--test
</option></term>
89 <listitem><para>Determine startup sequence, dump it and exit.
90 This is an option useful for debugging only.
</para></listitem>
93 <term><option>--dump-configuration-items
</option></term>
95 <listitem><para>Dump understood unit configuration items. This
96 outputs a terse but complete list of configuration items
97 understood in unit definition files.
</para></listitem>
100 <term><option>--dump-bus-properties
</option></term>
102 <listitem><para>Dump exposed bus properties. This outputs
103 a terse but complete list of properties exposed to dbus.
107 <term><option>--unit=
</option></term>
109 <listitem><para>Set default unit to activate on startup. If
110 not specified, defaults to
111 <filename>default.target
</filename>.
</para></listitem>
114 <term><option>--system
</option></term>
115 <term><option>--user
</option></term>
117 <listitem><para>For
<option>--system
</option>, tell systemd to
118 run a system instance, even if the process ID is not
1, i.e.
119 systemd is not run as init process.
<option>--user
</option>
120 does the opposite, running a user instance even if the process
121 ID is
1. Normally, it should not be necessary to pass these
122 options, as systemd automatically detects the mode it is
123 started in. These options are hence of little use except for
124 debugging. Note that it is not supported booting and
125 maintaining a full system with systemd running in
126 <option>--system
</option> mode, but PID not
1. In practice,
127 passing
<option>--system
</option> explicitly is only useful in
128 conjunction with
<option>--test
</option>.
</para></listitem>
131 <term><option>--dump-core
</option></term>
133 <listitem><para>Enable core dumping on crash. This switch has
134 no effect when running as user instance. This setting may also
135 be enabled during boot on the kernel command line via the
136 <varname>systemd.dump_core=
</varname> option, see
137 below.
</para></listitem>
141 <term><option>--crash-vt=
</option><replaceable>VT
</replaceable></term>
143 <listitem><para>Switch to a specific virtual console (VT) on
144 crash. Takes a positive integer in the range
1–
63, or a
145 boolean argument. If an integer is passed, selects which VT to
146 switch to. If
<constant>yes
</constant>, the VT kernel messages
147 are written to is selected. If
<constant>no
</constant>, no VT
148 switch is attempted. This switch has no effect when running as
149 user instance. This setting may also be enabled during boot,
150 on the kernel command line via the
151 <varname>systemd.crash_vt=
</varname> option, see
152 <!-- FIXME: there is no crash_vt command line option? -->
153 below.
</para></listitem>
157 <term><option>--crash-shell
</option></term>
159 <listitem><para>Run a shell on crash. This switch has no
160 effect when running as user instance. This setting may also be
161 enabled during boot, on the kernel command line via the
162 <varname>systemd.crash_shell=
</varname> option, see
163 below.
</para></listitem>
167 <term><option>--crash-reboot
</option></term>
169 <listitem><para>Automatically reboot the system on crash. This
170 switch has no effect when running as user instance. This
171 setting may also be enabled during boot, on the kernel command
172 line via the
<varname>systemd.crash_reboot=
</varname> option,
173 see below.
</para></listitem>
177 <term><option>--confirm-spawn
</option></term>
179 <listitem><para>Ask for confirmation when spawning processes.
180 This switch has no effect when run as user
181 instance.
</para></listitem>
184 <term><option>--show-status=
</option></term>
186 <listitem><para>Takes a boolean argument or the special value
<constant>auto
</constant>. If on, terse unit
187 status information is shown on the console during boot-up and shutdown. If off, no such status information is
188 shown. If set to
<constant>auto
</constant> behavior is similar to off, except that it is automatically switched
189 to on, as soon as the first unit failure or significant boot delay is encountered. This switch has no effect
190 when invoked as user instance. If specified, overrides both the kernel command line setting
191 <varname>systemd.show_status=
</varname> (see below) and the configuration file option
192 <option>ShowStatus=
</option>, see
193 <citerefentry><refentrytitle>systemd-system.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
196 <term><option>--log-target=
</option></term>
198 <listitem><para>Set log target. Argument must be one of
199 <option>console
</option>,
200 <option>journal
</option>,
201 <option>kmsg
</option>,
202 <option>journal-or-kmsg
</option>,
203 <option>null
</option>.
</para></listitem>
206 <term><option>--log-level=
</option></term>
208 <listitem><para>Set log level. As
209 argument this accepts a numerical log
210 level or the well-known
<citerefentry project='man-pages'
><refentrytitle>syslog
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
211 symbolic names (lowercase):
212 <option>emerg
</option>,
213 <option>alert
</option>,
214 <option>crit
</option>,
215 <option>err
</option>,
216 <option>warning
</option>,
217 <option>notice
</option>,
218 <option>info
</option>,
219 <option>debug
</option>.
</para></listitem>
222 <term><option>--log-color=
</option></term>
224 <listitem><para>Highlight important log messages. Argument is
225 a boolean value. If the argument is omitted, it defaults to
226 <option>true
</option>.
</para></listitem>
229 <term><option>--log-location=
</option></term>
231 <listitem><para>Include code location in log messages. This is
232 mostly relevant for debugging purposes. Argument is a boolean
233 value. If the argument is omitted it defaults to
234 <option>true
</option>.
</para></listitem>
237 <term><option>--default-standard-output=
</option></term>
238 <term><option>--default-standard-error=
</option></term>
240 <listitem><para>Sets the default output or error output for
241 all services and sockets, respectively. That is, controls the
242 default for
<option>StandardOutput=
</option> and
243 <option>StandardError=
</option> (see
244 <citerefentry><refentrytitle>systemd.exec
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
245 for details). Takes one of
246 <option>inherit
</option>,
247 <option>null
</option>,
248 <option>tty
</option>,
249 <option>journal
</option>,
250 <option>journal+console
</option>,
251 <option>syslog
</option>,
252 <option>syslog+console
</option>,
253 <option>kmsg
</option>,
254 <option>kmsg+console
</option>. If the
256 <option>--default-standard-output=
</option> defaults to
257 <option>journal
</option> and
258 <option>--default-standard-error=
</option> to
259 <option>inherit
</option>.
</para></listitem>
263 <term><option>--machine-id=
</option></term>
265 <listitem><para>Override the machine-id set on the hard drive,
266 useful for network booting or for containers. May not be set
267 to all zeros.
</para></listitem>
271 <term><option>--service-watchdogs=
</option></term>
273 <listitem><para>Globally enable/disable all service watchdog timeouts and emergency
274 actions. This setting may also be specified during boot, on the kernel
275 command line via the
<varname>systemd.service_watchdogs=
</varname>
276 option, see below. Defaults to enabled.
</para></listitem>
279 <xi:include href=
"standard-options.xml" xpointer=
"help" />
280 <xi:include href=
"standard-options.xml" xpointer=
"version" />
285 <title>Concepts
</title>
287 <para>systemd provides a dependency system between various
288 entities called
"units" of
11 different types. Units encapsulate
289 various objects that are relevant for system boot-up and
290 maintenance. The majority of units are configured in unit
291 configuration files, whose syntax and basic set of options is
293 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
294 however some are created automatically from other configuration,
295 dynamically from system state or programmatically at runtime.
296 Units may be
"active" (meaning started, bound, plugged in, …,
297 depending on the unit type, see below), or
"inactive" (meaning
298 stopped, unbound, unplugged, …), as well as in the process of
299 being activated or deactivated, i.e. between the two states (these
300 states are called
"activating",
"deactivating"). A special
301 "failed" state is available as well, which is very similar to
302 "inactive" and is entered when the service failed in some way
303 (process returned error code on exit, or crashed, an operation
304 timed out, or after too many restarts). If this state is entered,
305 the cause will be logged, for later reference. Note that the
306 various unit types may have a number of additional substates,
307 which are mapped to the five generalized unit states described
310 <para>The following unit types are available:
</para>
313 <listitem><para>Service units, which start and control daemons
314 and the processes they consist of. For details, see
315 <citerefentry><refentrytitle>systemd.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
317 <listitem><para>Socket units, which encapsulate local IPC or
318 network sockets in the system, useful for socket-based
319 activation. For details about socket units, see
320 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
321 for details on socket-based activation and other forms of
323 <citerefentry><refentrytitle>daemon
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
</para></listitem>
325 <listitem><para>Target units are useful to group units, or
326 provide well-known synchronization points during boot-up, see
327 <citerefentry><refentrytitle>systemd.target
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
329 <listitem><para>Device units expose kernel devices in systemd
330 and may be used to implement device-based activation. For
332 <citerefentry><refentrytitle>systemd.device
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
334 <listitem><para>Mount units control mount points in the file
335 system, for details see
336 <citerefentry><refentrytitle>systemd.mount
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
338 <listitem><para>Automount units provide automount capabilities,
339 for on-demand mounting of file systems as well as parallelized
341 <citerefentry><refentrytitle>systemd.automount
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
343 <listitem><para>Timer units are useful for triggering activation
344 of other units based on timers. You may find details in
345 <citerefentry><refentrytitle>systemd.timer
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
347 <listitem><para>Swap units are very similar to mount units and
348 encapsulate memory swap partitions or files of the operating
349 system. They are described in
350 <citerefentry><refentrytitle>systemd.swap
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
352 <listitem><para>Path units may be used to activate other
353 services when file system objects change or are modified. See
354 <citerefentry><refentrytitle>systemd.path
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
356 <listitem><para>Slice units may be used to group units which
357 manage system processes (such as service and scope units) in a
358 hierarchical tree for resource management purposes. See
359 <citerefentry><refentrytitle>systemd.slice
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
361 <listitem><para>Scope units are similar to service units, but
362 manage foreign processes instead of starting them as well. See
363 <citerefentry><refentrytitle>systemd.scope
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
367 <para>Units are named as their configuration files. Some units
368 have special semantics. A detailed list is available in
369 <citerefentry><refentrytitle>systemd.special
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
</para>
371 <para>systemd knows various kinds of dependencies, including
372 positive and negative requirement dependencies (i.e.
373 <varname>Requires=
</varname> and
<varname>Conflicts=
</varname>) as
374 well as ordering dependencies (
<varname>After=
</varname> and
375 <varname>Before=
</varname>). NB: ordering and requirement
376 dependencies are orthogonal. If only a requirement dependency
377 exists between two units (e.g.
<filename>foo.service
</filename>
378 requires
<filename>bar.service
</filename>), but no ordering
379 dependency (e.g.
<filename>foo.service
</filename> after
380 <filename>bar.service
</filename>) and both are requested to start,
381 they will be started in parallel. It is a common pattern that both
382 requirement and ordering dependencies are placed between two
383 units. Also note that the majority of dependencies are implicitly
384 created and maintained by systemd. In most cases, it should be
385 unnecessary to declare additional dependencies manually, however
386 it is possible to do this.
</para>
388 <para>Application programs and units (via dependencies) may
389 request state changes of units. In systemd, these requests are
390 encapsulated as 'jobs' and maintained in a job queue. Jobs may
391 succeed or can fail, their execution is ordered based on the
392 ordering dependencies of the units they have been scheduled
395 <para>On boot systemd activates the target unit
396 <filename>default.target
</filename> whose job is to activate
397 on-boot services and other on-boot units by pulling them in via
398 dependencies. Usually, the unit name is just an alias (symlink) for
399 either
<filename>graphical.target
</filename> (for fully-featured
400 boots into the UI) or
<filename>multi-user.target
</filename> (for
401 limited console-only boots for use in embedded or server
402 environments, or similar; a subset of graphical.target). However,
403 it is at the discretion of the administrator to configure it as an
404 alias to any other target unit. See
405 <citerefentry><refentrytitle>systemd.special
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
406 for details about these target units.
</para>
408 <para>Processes systemd spawns are placed in individual Linux
409 control groups named after the unit which they belong to in the
410 private systemd hierarchy. (see
<ulink
411 url=
"https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt">cgroups.txt
</ulink>
412 for more information about control groups, or short
"cgroups").
413 systemd uses this to effectively keep track of processes. Control
414 group information is maintained in the kernel, and is accessible
415 via the file system hierarchy (beneath
416 <filename>/sys/fs/cgroup/systemd/
</filename>), or in tools such as
417 <citerefentry project='man-pages'
><refentrytitle>systemd-cgls
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
419 <citerefentry project='man-pages'
><refentrytitle>ps
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
420 (
<command>ps xawf -eo pid,user,cgroup,args
</command> is
421 particularly useful to list all processes and the systemd units
422 they belong to.).
</para>
424 <para>systemd is compatible with the SysV init system to a large
425 degree: SysV init scripts are supported and simply read as an
426 alternative (though limited) configuration file format. The SysV
427 <filename>/dev/initctl
</filename> interface is provided, and
428 compatibility implementations of the various SysV client tools are
429 available. In addition to that, various established Unix
430 functionality such as
<filename>/etc/fstab
</filename> or the
431 <filename>utmp
</filename> database are supported.
</para>
433 <para>systemd has a minimal transaction system: if a unit is
434 requested to start up or shut down it will add it and all its
435 dependencies to a temporary transaction. Then, it will verify if
436 the transaction is consistent (i.e. whether the ordering of all
437 units is cycle-free). If it is not, systemd will try to fix it up,
438 and removes non-essential jobs from the transaction that might
439 remove the loop. Also, systemd tries to suppress non-essential
440 jobs in the transaction that would stop a running service. Finally
441 it is checked whether the jobs of the transaction contradict jobs
442 that have already been queued, and optionally the transaction is
443 aborted then. If all worked out and the transaction is consistent
444 and minimized in its impact it is merged with all already
445 outstanding jobs and added to the run queue. Effectively this
446 means that before executing a requested operation, systemd will
447 verify that it makes sense, fixing it if possible, and only
448 failing if it really cannot work.
</para>
450 <para>systemd contains native implementations of various tasks
451 that need to be executed as part of the boot process. For example,
452 it sets the hostname or configures the loopback network device. It
453 also sets up and mounts various API file systems, such as
454 <filename>/sys
</filename> or
<filename>/proc
</filename>.
</para>
456 <para>For more information about the concepts and
457 ideas behind systemd, please refer to the
458 <ulink url=
"http://0pointer.de/blog/projects/systemd.html">Original Design Document
</ulink>.
</para>
460 <para>Note that some but not all interfaces provided
461 by systemd are covered by the
462 <ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/InterfaceStabilityPromise">Interface
463 Stability Promise
</ulink>.
</para>
465 <para>Units may be generated dynamically at boot and system
466 manager reload time, for example based on other configuration
467 files or parameters passed on the kernel command line. For details, see
468 <citerefentry><refentrytitle>systemd.generator
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
</para>
470 <para>Systems which invoke systemd in a container or initrd
471 environment should implement the
472 <ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface">Container Interface
</ulink> or
473 <ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/InitrdInterface">initrd Interface
</ulink>
474 specifications, respectively.
</para>
478 <title>Directories
</title>
482 <term>System unit directories
</term>
484 <listitem><para>The systemd system manager reads unit
485 configuration from various directories. Packages that want to
486 install unit files shall place them in the directory returned
487 by
<command>pkg-config systemd
488 --variable=systemdsystemunitdir
</command>. Other directories
489 checked are
<filename>/usr/local/lib/systemd/system
</filename>
490 and
<filename>/usr/lib/systemd/system
</filename>. User
491 configuration always takes precedence.
<command>pkg-config
492 systemd --variable=systemdsystemconfdir
</command> returns the
493 path of the system configuration directory. Packages should
494 alter the content of these directories only with the
495 <command>enable
</command> and
<command>disable
</command>
497 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
498 tool. Full list of directories is provided in
499 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
506 <term>User unit directories
</term>
508 <listitem><para>Similar rules apply for the user unit
509 directories. However, here the
510 <ulink url=
"http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG
511 Base Directory specification
</ulink> is followed to find
512 units. Applications should place their unit files in the
513 directory returned by
<command>pkg-config systemd
514 --variable=systemduserunitdir
</command>. Global configuration
515 is done in the directory reported by
<command>pkg-config
516 systemd --variable=systemduserconfdir
</command>. The
517 <command>enable
</command> and
<command>disable
</command>
519 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
520 tool can handle both global (i.e. for all users) and private
521 (for one user) enabling/disabling of units. Full list of
522 directories is provided in
523 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
530 <term>SysV init scripts directory
</term>
532 <listitem><para>The location of the SysV init script directory
533 varies between distributions. If systemd cannot find a native
534 unit file for a requested service, it will look for a SysV
535 init script of the same name (with the
536 <filename>.service
</filename> suffix
537 removed).
</para></listitem>
543 <term>SysV runlevel link farm directory
</term>
545 <listitem><para>The location of the SysV runlevel link farm
546 directory varies between distributions. systemd will take the
547 link farm into account when figuring out whether a service
548 shall be enabled. Note that a service unit with a native unit
549 configuration file cannot be started by activating it in the
550 SysV runlevel link farm.
</para></listitem>
556 <title>Signals
</title>
560 <term><constant>SIGTERM
</constant></term>
562 <listitem><para>Upon receiving this signal the systemd system
563 manager serializes its state, reexecutes itself and
564 deserializes the saved state again. This is mostly equivalent
565 to
<command>systemctl daemon-reexec
</command>.
</para>
567 <para>systemd user managers will start the
568 <filename>exit.target
</filename> unit when this signal is
569 received. This is mostly equivalent to
<command>systemctl
570 --user start exit.target
571 --job-mode=replace-irreversible
</command>.
</para></listitem>
575 <term><constant>SIGINT
</constant></term>
577 <listitem><para>Upon receiving this signal the systemd system
578 manager will start the
579 <filename>ctrl-alt-del.target
</filename> unit. This is mostly
580 equivalent to
<command>systemctl start ctrl-alt-del.target
581 --job-mode=replace-irreversible
</command>. If this signal is
582 received more than
7 times per
2s, an immediate reboot is
583 triggered. Note that pressing Ctrl-Alt-Del on the console
584 will trigger this signal. Hence, if a reboot is hanging,
585 pressing Ctrl-Alt-Del more than
7 times in
2s is a relatively
586 safe way to trigger an immediate reboot.
</para>
588 <para>systemd user managers treat this signal the same way as
589 <constant>SIGTERM
</constant>.
</para></listitem>
593 <term><constant>SIGWINCH
</constant></term>
595 <listitem><para>When this signal is received the systemd
596 system manager will start the
597 <filename>kbrequest.target
</filename> unit. This is mostly
598 equivalent to
<command>systemctl start
599 kbrequest.target
</command>.
</para>
601 <para>This signal is ignored by systemd user
602 managers.
</para></listitem>
606 <term><constant>SIGPWR
</constant></term>
608 <listitem><para>When this signal is received the systemd
609 manager will start the
<filename>sigpwr.target
</filename>
610 unit. This is mostly equivalent to
<command>systemctl start
611 sigpwr.target
</command>.
</para></listitem>
615 <term><constant>SIGUSR1
</constant></term>
617 <listitem><para>When this signal is received the systemd
618 manager will try to reconnect to the D-Bus
619 bus.
</para></listitem>
623 <term><constant>SIGUSR2
</constant></term>
625 <listitem><para>When this signal is received the systemd
626 manager will log its complete state in human-readable form.
627 The data logged is the same as printed by
628 <command>systemd-analyze dump
</command>.
</para></listitem>
632 <term><constant>SIGHUP
</constant></term>
634 <listitem><para>Reloads the complete daemon configuration.
635 This is mostly equivalent to
<command>systemctl
636 daemon-reload
</command>.
</para></listitem>
640 <term><constant>SIGRTMIN+
0</constant></term>
642 <listitem><para>Enters default mode, starts the
643 <filename>default.target
</filename> unit. This is mostly
644 equivalent to
<command>systemctl isolate
645 default.target
</command>.
</para></listitem>
649 <term><constant>SIGRTMIN+
1</constant></term>
651 <listitem><para>Enters rescue mode, starts the
652 <filename>rescue.target
</filename> unit. This is mostly
653 equivalent to
<command>systemctl isolate
654 rescue.target
</command>.
</para></listitem>
658 <term><constant>SIGRTMIN+
2</constant></term>
660 <listitem><para>Enters emergency mode, starts the
661 <filename>emergency.service
</filename> unit. This is mostly
662 equivalent to
<command>systemctl isolate
663 emergency.service
</command>.
</para></listitem>
667 <term><constant>SIGRTMIN+
3</constant></term>
669 <listitem><para>Halts the machine, starts the
670 <filename>halt.target
</filename> unit. This is mostly
671 equivalent to
<command>systemctl start halt.target
672 --job-mode=replace-irreversible
</command>.
</para>
677 <term><constant>SIGRTMIN+
4</constant></term>
679 <listitem><para>Powers off the machine, starts the
680 <filename>poweroff.target
</filename> unit. This is mostly
681 equivalent to
<command>systemctl start poweroff.target
682 --job-mode=replace-irreversible
</command>.
</para>
687 <term><constant>SIGRTMIN+
5</constant></term>
689 <listitem><para>Reboots the machine, starts the
690 <filename>reboot.target
</filename> unit. This is mostly
691 equivalent to
<command>systemctl start reboot.target
692 --job-mode=replace-irreversible
</command>.
</para>
697 <term><constant>SIGRTMIN+
6</constant></term>
699 <listitem><para>Reboots the machine via kexec, starts the
700 <filename>kexec.target
</filename> unit. This is mostly
701 equivalent to
<command>systemctl start kexec.target
702 --job-mode=replace-irreversible
</command>.
</para>
707 <term><constant>SIGRTMIN+
13</constant></term>
709 <listitem><para>Immediately halts the machine.
</para></listitem>
713 <term><constant>SIGRTMIN+
14</constant></term>
715 <listitem><para>Immediately powers off the machine.
</para></listitem>
719 <term><constant>SIGRTMIN+
15</constant></term>
721 <listitem><para>Immediately reboots the machine.
</para></listitem>
725 <term><constant>SIGRTMIN+
16</constant></term>
727 <listitem><para>Immediately reboots the machine with kexec.
</para></listitem>
731 <term><constant>SIGRTMIN+
20</constant></term>
733 <listitem><para>Enables display of status messages on the
734 console, as controlled via
735 <varname>systemd.show_status=
1</varname> on the kernel command
736 line.
</para></listitem>
740 <term><constant>SIGRTMIN+
21</constant></term>
742 <listitem><para>Disables display of
743 status messages on the console, as
745 <varname>systemd.show_status=
0</varname>
746 on the kernel command
747 line.
</para></listitem>
751 <term><constant>SIGRTMIN+
22</constant></term>
752 <term><constant>SIGRTMIN+
23</constant></term>
754 <listitem><para>Sets the log level to
<literal>debug
</literal>
755 (or
<literal>info
</literal> on
756 <constant>SIGRTMIN+
23</constant>), as controlled via
757 <varname>systemd.log_level=debug
</varname> (or
758 <varname>systemd.log_level=info
</varname> on
759 <constant>SIGRTMIN+
23</constant>) on the kernel command
760 line.
</para></listitem>
764 <term><constant>SIGRTMIN+
24</constant></term>
766 <listitem><para>Immediately exits the manager (only available
767 for --user instances).
</para></listitem>
771 <term><constant>SIGRTMIN+
26</constant></term>
772 <term><constant>SIGRTMIN+
27</constant></term>
773 <term><constant>SIGRTMIN+
28</constant></term>
775 <listitem><para>Sets the log target to
776 <literal>journal-or-kmsg
</literal> (or
777 <literal>console
</literal> on
778 <constant>SIGRTMIN+
27</constant>,
<literal>kmsg
</literal> on
779 <constant>SIGRTMIN+
28</constant>), as controlled via
780 <varname>systemd.log_target=journal-or-kmsg
</varname> (or
781 <varname>systemd.log_target=console
</varname> on
782 <constant>SIGRTMIN+
27</constant> or
783 <varname>systemd.log_target=kmsg
</varname> on
784 <constant>SIGRTMIN+
28</constant>) on the kernel command
785 line.
</para></listitem>
791 <title>Environment
</title>
793 <variablelist class='environment-variables'
>
795 <term><varname>$SYSTEMD_LOG_LEVEL
</varname></term>
796 <listitem><para>systemd reads the log level from this
797 environment variable. This can be overridden with
798 <option>--log-level=
</option>.
</para></listitem>
802 <term><varname>$SYSTEMD_LOG_TARGET
</varname></term>
803 <listitem><para>systemd reads the log target from this
804 environment variable. This can be overridden with
805 <option>--log-target=
</option>.
</para></listitem>
809 <term><varname>$SYSTEMD_LOG_COLOR
</varname></term>
810 <listitem><para>Controls whether systemd highlights important
811 log messages. This can be overridden with
812 <option>--log-color=
</option>.
</para></listitem>
816 <term><varname>$SYSTEMD_LOG_LOCATION
</varname></term>
817 <listitem><para>Controls whether systemd prints the code
818 location along with log messages. This can be overridden with
819 <option>--log-location=
</option>.
</para></listitem>
823 <term><varname>$XDG_CONFIG_HOME
</varname></term>
824 <term><varname>$XDG_CONFIG_DIRS
</varname></term>
825 <term><varname>$XDG_DATA_HOME
</varname></term>
826 <term><varname>$XDG_DATA_DIRS
</varname></term>
828 <listitem><para>The systemd user manager uses these variables
829 in accordance to the
<ulink
830 url=
"http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG
831 Base Directory specification
</ulink> to find its
832 configuration.
</para></listitem>
836 <term><varname>$SYSTEMD_UNIT_PATH
</varname></term>
838 <listitem><para>Controls where systemd looks for unit
839 files.
</para></listitem>
843 <term><varname>$SYSTEMD_SYSVINIT_PATH
</varname></term>
845 <listitem><para>Controls where systemd looks for SysV init
846 scripts.
</para></listitem>
850 <term><varname>$SYSTEMD_SYSVRCND_PATH
</varname></term>
852 <listitem><para>Controls where systemd looks for SysV init
853 script runlevel link farms.
</para></listitem>
857 <term><varname>$SYSTEMD_COLORS
</varname></term>
859 <listitem><para>The value must be a boolean. Controls whether colorized output should be
860 generated. This can be specified to override the decision that
<command>systemd
</command>
861 makes based on
<varname>$TERM
</varname> and what the console is connected to.
</para>
866 <term><varname>$SYSTEMD_URLIFY
</varname></term>
868 <listitem><para>The value must be a boolean. Controls whether clickable links should be generated in the output
869 for terminal emulators supporting this. This can be specified to override the decision that
870 <command>systemd
</command> makes based on
<varname>$TERM
</varname> and other conditions.
</para>
875 <term><varname>$LISTEN_PID
</varname></term>
876 <term><varname>$LISTEN_FDS
</varname></term>
877 <term><varname>$LISTEN_FDNAMES
</varname></term>
879 <listitem><para>Set by systemd for supervised processes during
880 socket-based activation. See
881 <citerefentry><refentrytitle>sd_listen_fds
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
882 for more information.
</para></listitem>
886 <term><varname>$NOTIFY_SOCKET
</varname></term>
888 <listitem><para>Set by systemd for supervised processes for
889 status and start-up completion notification. See
890 <citerefentry><refentrytitle>sd_notify
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
891 for more information.
</para></listitem>
897 <title>Kernel Command Line
</title>
899 <para>When run as system instance systemd parses a number of
900 kernel command line arguments
<footnote><para>If run inside a Linux
901 container these arguments may be passed as command line arguments
902 to systemd itself, next to any of the command line options listed
903 in the Options section above. If run outside of Linux containers,
904 these arguments are parsed from
<filename>/proc/cmdline
</filename>
905 instead.
</para></footnote>:
</para>
907 <variablelist class='kernel-commandline-options'
>
909 <term><varname>systemd.unit=
</varname></term>
910 <term><varname>rd.systemd.unit=
</varname></term>
912 <listitem><para>Overrides the unit to activate on boot.
913 Defaults to
<filename>default.target
</filename>. This may be
914 used to temporarily boot into a different boot unit, for
915 example
<filename>rescue.target
</filename> or
916 <filename>emergency.service
</filename>. See
917 <citerefentry><refentrytitle>systemd.special
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
918 for details about these units. The option prefixed with
919 <literal>rd.
</literal> is honored only in the initial RAM disk
920 (initrd), while the one that is not prefixed only in the main
921 system.
</para></listitem>
925 <term><varname>systemd.dump_core
</varname></term>
927 <listitem><para>Takes a boolean argument or enables the option if specified
928 without an argument. If enabled, the systemd manager (PID
1) dumps core when
929 it crashes. Otherwise, no core dump is created. Defaults to enabled.
</para>
934 <term><varname>systemd.crash_chvt
</varname></term>
936 <listitem><para>Takes a positive integer, or a boolean argument. Can be also
937 specified without an argument, with the same effect as a positive boolean. If
938 a positive integer (in the range
1–
63) is specified, the system manager (PID
939 1) will activate the specified virtual terminal (VT) when it
940 crashes. Defaults to disabled, meaning that no such switch is attempted. If
941 set to enabled, the VT the kernel messages are written to is selected.
946 <term><varname>systemd.crash_shell
</varname></term>
948 <listitem><para>Takes a boolean argument or enables the option if specified
949 without an argument. If enabled, the system manager (PID
1) spawns a shell
950 when it crashes, after a
10s delay. Otherwise, no shell is spawned. Defaults
951 to disabled, for security reasons, as the shell is not protected by password
952 authentication.
</para></listitem>
956 <term><varname>systemd.crash_reboot
</varname></term>
958 <listitem><para>Takes a boolean argument or enables the option if specified
959 without an argument. If enabled, the system manager (PID
1) will reboot the
960 machine automatically when it crashes, after a
10s delay. Otherwise, the
961 system will hang indefinitely. Defaults to disabled, in order to avoid a
962 reboot loop. If combined with
<varname>systemd.crash_shell
</varname>, the
963 system is rebooted after the shell exits.
</para></listitem>
967 <term><varname>systemd.confirm_spawn
</varname></term>
969 <listitem><para>Takes a boolean argument or a path to the virtual console
970 where the confirmation messages should be emitted. Can be also specified
971 without an argument, with the same effect as a positive boolean. If enabled,
972 the system manager (PID
1) asks for confirmation when spawning processes
973 using
<option>/dev/console
</option>. If a path or a console name (such as
974 <literal>ttyS0
</literal>) is provided, the virtual console pointed to by this
975 path or described by the give name will be used instead. Defaults to disabled.
980 <term><varname>systemd.service_watchdogs=
</varname></term>
982 <listitem><para>Takes a boolean argument. If disabled, all service runtime
983 watchdogs (
<option>WatchdogSec=
</option>) and emergency actions (e.g.
984 <option>OnFailure=
</option> or
<option>StartLimitAction=
</option>) are
985 ignored by the system manager (PID
1); see
986 <citerefentry><refentrytitle>systemd.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
987 Defaults to enabled, i.e. watchdogs and failure actions are processed
988 normally. The hardware watchdog is not affected by this
989 option.
</para></listitem>
993 <term><varname>systemd.show_status
</varname></term>
995 <listitem><para>Takes a boolean argument or the constant
996 <constant>auto
</constant>. Can be also specified without an argument, with
997 the same effect as a positive boolean. If enabled, the systemd manager (PID
998 1) shows terse service status updates on the console during bootup.
999 <constant>auto
</constant> behaves like
<option>false
</option> until a unit
1000 fails or there is a significant delay in boot. Defaults to enabled, unless
1001 <option>quiet
</option> is passed as kernel command line option, in which case
1002 it defaults to
<constant>auto
</constant>. If specified overrides the system
1003 manager configuration file option
<option>ShowStatus=
</option>, see
1004 <citerefentry><refentrytitle>systemd-system.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1005 However, the process command line option
<option>--show-status=
</option>
1006 takes precedence over both this kernel command line option and the
1007 configuration file option.
</para></listitem>
1011 <term><varname>systemd.log_target=
</varname></term>
1012 <term><varname>systemd.log_level=
</varname></term>
1013 <term><varname>systemd.log_location=
</varname></term>
1014 <term><varname>systemd.log_color
</varname></term>
1016 <listitem><para>Controls log output, with the same effect as the
1017 <varname>$SYSTEMD_LOG_TARGET
</varname>,
1018 <varname>$SYSTEMD_LOG_LEVEL
</varname>,
1019 <varname>$SYSTEMD_LOG_LOCATION
</varname>,
1020 <varname>$SYSTEMD_LOG_COLOR
</varname> environment variables described above.
1021 <varname>systemd.log_color
</varname> can be specified without an argument,
1022 with the same effect as a positive boolean.
</para></listitem>
1026 <term><varname>systemd.default_standard_output=
</varname></term>
1027 <term><varname>systemd.default_standard_error=
</varname></term>
1028 <listitem><para>Controls default standard output and error
1029 output for services, with the same effect as the
1030 <option>--default-standard-output=
</option> and
1031 <option>--default-standard-error=
</option> command line
1032 arguments described above, respectively.
</para></listitem>
1036 <term><varname>systemd.setenv=
</varname></term>
1038 <listitem><para>Takes a string argument in the form
1039 VARIABLE=VALUE. May be used to set default environment
1040 variables to add to forked child processes. May be used more
1041 than once to set multiple variables.
</para></listitem>
1045 <term><varname>systemd.machine_id=
</varname></term>
1047 <listitem><para>Takes a
32 character hex value to be
1048 used for setting the machine-id. Intended mostly for
1049 network booting where the same machine-id is desired
1050 for every boot.
</para></listitem>
1054 <term><varname>systemd.unified_cgroup_hierarchy
</varname></term>
1056 <listitem><para>When specified without an argument or with a true argument,
1057 enables the usage of
1058 <ulink url=
"https://www.kernel.org/doc/Documentation/cgroup-v2.txt">unified cgroup hierarchy
</ulink>
1059 (a.k.a. cgroups-v2). When specified with a false argument, fall back to
1060 hybrid or full legacy cgroup hierarchy.
</para>
1062 <para>If this option is not specified, the default behaviour is determined
1063 during compilation (the
<option>--with-default-hierarchy=
</option>
1064 option). If the kernel does not support unified cgroup hierarchy, the legacy
1065 hierarchy will be used even if this option is specified.
</para>
1070 <term><varname>systemd.legacy_systemd_cgroup_controller
</varname></term>
1072 <listitem><para>Takes effect if the full unified cgroup hierarchy is not used
1073 (see previous option). When specified without an argument or with a true
1074 argument, disables the use of
"hybrid" cgroup hierarchy (i.e. a cgroups-v2
1075 tree used for systemd, and
1076 <ulink url=
"https://www.kernel.org/doc/Documentation/cgroup-v1/">legacy
1077 cgroup hierarchy
</ulink>, a.k.a. cgroups-v1, for other controllers), and
1078 forces a full
"legacy" mode. When specified with a false argument, enables
1079 the use of
"hybrid" hierarchy.
</para>
1081 <para>If this option is not specified, the default behaviour is determined
1082 during compilation (the
<option>--with-default-hierarchy=
</option>
1083 option). If the kernel does not support unified cgroup hierarchy, the legacy
1084 hierarchy will be used even if this option is specified.
</para>
1089 <term><varname>quiet
</varname></term>
1091 <listitem><para>Turn off status output at boot, much like
1092 <varname>systemd.show_status=false
</varname> would. Note that
1093 this option is also read by the kernel itself and disables
1094 kernel log output. Passing this option hence turns off the
1095 usual output from both the system manager and the kernel.
1100 <term><varname>debug
</varname></term>
1102 <listitem><para>Turn on debugging output. This is equivalent
1103 to
<varname>systemd.log_level=debug
</varname>. Note that this
1104 option is also read by the kernel itself and enables kernel
1105 debug output. Passing this option hence turns on the debug
1106 output from both the system manager and the
1107 kernel.
</para></listitem>
1111 <term><varname>emergency
</varname></term>
1112 <term><varname>rd.emergency
</varname></term>
1113 <term><varname>-b
</varname></term>
1115 <listitem><para>Boot into emergency mode. This is equivalent
1116 to
<varname>systemd.unit=emergency.target
</varname> or
1117 <varname>rd.systemd.unit=emergency.target
</varname>, respectively, and
1118 provided for compatibility reasons and to be easier to type.
</para></listitem>
1122 <term><varname>rescue
</varname></term>
1123 <term><varname>rd.rescue
</varname></term>
1124 <term><varname>single
</varname></term>
1125 <term><varname>s
</varname></term>
1126 <term><varname>S
</varname></term>
1127 <term><varname>1</varname></term>
1129 <listitem><para>Boot into rescue mode. This is equivalent to
1130 <varname>systemd.unit=rescue.target
</varname> or
1131 <varname>rd.systemd.unit=rescue.target
</varname>, respectively, and
1132 provided for compatibility reasons and to be easier to type.
</para></listitem>
1136 <term><varname>2</varname></term>
1137 <term><varname>3</varname></term>
1138 <term><varname>4</varname></term>
1139 <term><varname>5</varname></term>
1141 <listitem><para>Boot into the specified legacy SysV runlevel.
1142 These are equivalent to
1143 <varname>systemd.unit=runlevel2.target
</varname>,
1144 <varname>systemd.unit=runlevel3.target
</varname>,
1145 <varname>systemd.unit=runlevel4.target
</varname>, and
1146 <varname>systemd.unit=runlevel5.target
</varname>,
1147 respectively, and provided for compatibility reasons and to be
1148 easier to type.
</para></listitem>
1152 <term><varname>locale.LANG=
</varname></term>
1153 <term><varname>locale.LANGUAGE=
</varname></term>
1154 <term><varname>locale.LC_CTYPE=
</varname></term>
1155 <term><varname>locale.LC_NUMERIC=
</varname></term>
1156 <term><varname>locale.LC_TIME=
</varname></term>
1157 <term><varname>locale.LC_COLLATE=
</varname></term>
1158 <term><varname>locale.LC_MONETARY=
</varname></term>
1159 <term><varname>locale.LC_MESSAGES=
</varname></term>
1160 <term><varname>locale.LC_PAPER=
</varname></term>
1161 <term><varname>locale.LC_NAME=
</varname></term>
1162 <term><varname>locale.LC_ADDRESS=
</varname></term>
1163 <term><varname>locale.LC_TELEPHONE=
</varname></term>
1164 <term><varname>locale.LC_MEASUREMENT=
</varname></term>
1165 <term><varname>locale.LC_IDENTIFICATION=
</varname></term>
1167 <listitem><para>Set the system locale to use. This overrides
1168 the settings in
<filename>/etc/locale.conf
</filename>. For
1169 more information, see
1170 <citerefentry project='man-pages'
><refentrytitle>locale.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1172 <citerefentry project='man-pages'
><refentrytitle>locale
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
1177 <para>For other kernel command line parameters understood by
1178 components of the core OS, please refer to
1179 <citerefentry><refentrytitle>kernel-command-line
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
</para>
1183 <title>Sockets and FIFOs
</title>
1187 <term><filename>/run/systemd/notify
</filename></term>
1189 <listitem><para>Daemon status notification socket. This is an
1190 <constant>AF_UNIX
</constant> datagram socket and is used to
1191 implement the daemon notification logic as implemented by
1192 <citerefentry><refentrytitle>sd_notify
</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para></listitem>
1197 <term><filename>/run/systemd/private
</filename></term>
1199 <listitem><para>Used internally as communication channel
1201 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1202 and the systemd process. This is an
1203 <constant>AF_UNIX
</constant> stream socket. This interface is
1204 private to systemd and should not be used in external
1205 projects.
</para></listitem>
1209 <term><filename>/dev/initctl
</filename></term>
1211 <listitem><para>Limited compatibility support for the SysV
1212 client interface, as implemented by the
1213 <filename>systemd-initctl.service
</filename> unit. This is a
1214 named pipe in the file system. This interface is obsolete and
1215 should not be used in new applications.
</para></listitem>
1221 <title>See Also
</title>
1223 The
<ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/">systemd Homepage
</ulink>,
1224 <citerefentry><refentrytitle>systemd-system.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1225 <citerefentry project='man-pages'
><refentrytitle>locale.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1226 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1227 <citerefentry><refentrytitle>journalctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1228 <citerefentry><refentrytitle>systemd-notify
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1229 <citerefentry><refentrytitle>daemon
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1230 <citerefentry><refentrytitle>sd-daemon
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
1231 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1232 <citerefentry><refentrytitle>systemd.special
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1233 <citerefentry project='die-net'
><refentrytitle>pkg-config
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1234 <citerefentry><refentrytitle>kernel-command-line
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1235 <citerefentry project='man-pages'
><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1236 <citerefentry><refentrytitle>systemd.directives
</refentrytitle><manvolnum>7</manvolnum></citerefentry>