]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.xml
man: improve ShowStatus=/systemd.show_status=/--show-status= documentation
[thirdparty/systemd.git] / man / systemd.xml
1 <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
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="systemd"
25 xmlns:xi="http://www.w3.org/2001/XInclude">
26
27 <refentryinfo>
28 <title>systemd</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>systemd</refentrytitle>
43 <manvolnum>1</manvolnum>
44 </refmeta>
45
46 <refnamediv>
47 <refname>systemd</refname>
48 <refname>init</refname>
49 <refpurpose>systemd system and service manager</refpurpose>
50 </refnamediv>
51
52 <refsynopsisdiv>
53 <cmdsynopsis>
54 <command>systemd <arg choice="opt" rep="repeat">OPTIONS</arg></command>
55 </cmdsynopsis>
56 <cmdsynopsis>
57 <command>init <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg></command>
58 </cmdsynopsis>
59 </refsynopsisdiv>
60
61 <refsect1>
62 <title>Description</title>
63
64 <para>systemd is a system and service manager for Linux operating
65 systems. When run as first process on boot (as PID 1), it acts as
66 init system that brings up and maintains userspace
67 services.</para>
68
69 <para>For compatibility with SysV, if systemd is called as
70 <command>init</command> and a PID that is not 1, it will execute
71 <command>telinit</command> and pass all command line arguments
72 unmodified. That means <command>init</command> and
73 <command>telinit</command> are mostly equivalent when invoked from
74 normal login sessions. See
75 <citerefentry><refentrytitle>telinit</refentrytitle><manvolnum>8</manvolnum></citerefentry>
76 for more information.</para>
77
78 <para>When run as a system instance, systemd interprets the
79 configuration file <filename>system.conf</filename> and the files
80 in <filename>system.conf.d</filename> directories; when run as a
81 user instance, systemd interprets the configuration file
82 <filename>user.conf</filename> and the files in
83 <filename>user.conf.d</filename> directories. See
84 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
85 for more information.</para>
86 </refsect1>
87
88 <refsect1>
89 <title>Options</title>
90
91 <para>The following options are understood:</para>
92
93 <variablelist>
94 <varlistentry>
95 <term><option>--test</option></term>
96
97 <listitem><para>Determine startup sequence, dump it and exit.
98 This is an option useful for debugging only.</para></listitem>
99 </varlistentry>
100 <varlistentry>
101 <term><option>--dump-configuration-items</option></term>
102
103 <listitem><para>Dump understood unit configuration items. This
104 outputs a terse but complete list of configuration items
105 understood in unit definition files.</para></listitem>
106 </varlistentry>
107 <varlistentry>
108 <term><option>--unit=</option></term>
109
110 <listitem><para>Set default unit to activate on startup. If
111 not specified, defaults to
112 <filename>default.target</filename>.</para></listitem>
113 </varlistentry>
114 <varlistentry>
115 <term><option>--system</option></term>
116 <term><option>--user</option></term>
117
118 <listitem><para>For <option>--system</option>, tell systemd to
119 run a system instance, even if the process ID is not 1, i.e.
120 systemd is not run as init process. <option>--user</option>
121 does the opposite, running a user instance even if the process
122 ID is 1. Normally, it should not be necessary to pass these
123 options, as systemd automatically detects the mode it is
124 started in. These options are hence of little use except for
125 debugging. Note that it is not supported booting and
126 maintaining a full system with systemd running in
127 <option>--system</option> mode, but PID not 1. In practice,
128 passing <option>--system</option> explicitly is only useful in
129 conjunction with <option>--test</option>.</para></listitem>
130 </varlistentry>
131 <varlistentry>
132 <term><option>--dump-core</option></term>
133
134 <listitem><para>Enable core dumping on crash. This switch has
135 no effect when running as user instance. This setting may also
136 be enabled during boot on the kernel command line via the
137 <varname>systemd.dump_core=</varname> option, see
138 below.</para></listitem>
139 </varlistentry>
140
141 <varlistentry>
142 <term><option>--crash-vt=</option><replaceable>VT</replaceable></term>
143
144 <listitem><para>Switch to a specific virtual console (VT) on
145 crash. Takes a positive integer in the range 163, or a
146 boolean argument. If an integer is passed, selects which VT to
147 switch to. If <constant>yes</constant>, the VT kernel messages
148 are written to is selected. If <constant>no</constant>, no VT
149 switch is attempted. This switch has no effect when running as
150 user instance. This setting may also be enabled during boot,
151 on the kernel command line via the
152 <varname>systemd.crash_vt=</varname> option, see
153 below.</para></listitem>
154 </varlistentry>
155
156 <varlistentry>
157 <term><option>--crash-shell</option></term>
158
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>
164 </varlistentry>
165
166 <varlistentry>
167 <term><option>--crash-reboot</option></term>
168
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>
174 </varlistentry>
175
176 <varlistentry>
177 <term><option>--confirm-spawn</option></term>
178
179 <listitem><para>Ask for confirmation when spawning processes.
180 This switch has no effect when run as user
181 instance.</para></listitem>
182 </varlistentry>
183 <varlistentry>
184 <term><option>--show-status=</option></term>
185
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>
194 </varlistentry>
195 <varlistentry>
196 <term><option>--log-target=</option></term>
197
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>
204 </varlistentry>
205 <varlistentry>
206 <term><option>--log-level=</option></term>
207
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>
220 </varlistentry>
221 <varlistentry>
222 <term><option>--log-color=</option></term>
223
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>
227 </varlistentry>
228 <varlistentry>
229 <term><option>--log-location=</option></term>
230
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>
235 </varlistentry>
236 <varlistentry>
237 <term><option>--default-standard-output=</option></term>
238 <term><option>--default-standard-error=</option></term>
239
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
255 argument is omitted
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>
260 </varlistentry>
261
262 <varlistentry>
263 <term><option>--machine-id=</option></term>
264
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>
268 </varlistentry>
269
270 <xi:include href="standard-options.xml" xpointer="help" />
271 <xi:include href="standard-options.xml" xpointer="version" />
272 </variablelist>
273 </refsect1>
274
275 <refsect1>
276 <title>Concepts</title>
277
278 <para>systemd provides a dependency system between various
279 entities called "units" of 11 different types. Units encapsulate
280 various objects that are relevant for system boot-up and
281 maintenance. The majority of units are configured in unit
282 configuration files, whose syntax and basic set of options is
283 described in
284 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
285 however some are created automatically from other configuration,
286 dynamically from system state or programmatically at runtime.
287 Units may be "active" (meaning started, bound, plugged in, …,
288 depending on the unit type, see below), or "inactive" (meaning
289 stopped, unbound, unplugged, …), as well as in the process of
290 being activated or deactivated, i.e. between the two states (these
291 states are called "activating", "deactivating"). A special
292 "failed" state is available as well, which is very similar to
293 "inactive" and is entered when the service failed in some way
294 (process returned error code on exit, or crashed, or an operation
295 timed out). If this state is entered, the cause will be logged,
296 for later reference. Note that the various unit types may have a
297 number of additional substates, which are mapped to the five
298 generalized unit states described here.</para>
299
300 <para>The following unit types are available:</para>
301
302 <orderedlist>
303 <listitem><para>Service units, which start and control daemons
304 and the processes they consist of. For details, see
305 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
306
307 <listitem><para>Socket units, which encapsulate local IPC or
308 network sockets in the system, useful for socket-based
309 activation. For details about socket units, see
310 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
311 for details on socket-based activation and other forms of
312 activation, see
313 <citerefentry><refentrytitle>daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para></listitem>
314
315 <listitem><para>Target units are useful to group units, or
316 provide well-known synchronization points during boot-up, see
317 <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
318
319 <listitem><para>Device units expose kernel devices in systemd
320 and may be used to implement device-based activation. For
321 details, see
322 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
323
324 <listitem><para>Mount units control mount points in the file
325 system, for details see
326 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
327
328 <listitem><para>Automount units provide automount capabilities,
329 for on-demand mounting of file systems as well as parallelized
330 boot-up. See
331 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
332
333 <listitem><para>Timer units are useful for triggering activation
334 of other units based on timers. You may find details in
335 <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
336
337 <listitem><para>Swap units are very similar to mount units and
338 encapsulate memory swap partitions or files of the operating
339 system. They are described in
340 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
341
342 <listitem><para>Path units may be used to activate other
343 services when file system objects change or are modified. See
344 <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
345
346 <listitem><para>Slice units may be used to group units which
347 manage system processes (such as service and scope units) in a
348 hierarchical tree for resource management purposes. See
349 <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
350
351 <listitem><para>Scope units are similar to service units, but
352 manage foreign processes instead of starting them as well. See
353 <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
354
355 </orderedlist>
356
357 <para>Units are named as their configuration files. Some units
358 have special semantics. A detailed list is available in
359 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
360
361 <para>systemd knows various kinds of dependencies, including
362 positive and negative requirement dependencies (i.e.
363 <varname>Requires=</varname> and <varname>Conflicts=</varname>) as
364 well as ordering dependencies (<varname>After=</varname> and
365 <varname>Before=</varname>). NB: ordering and requirement
366 dependencies are orthogonal. If only a requirement dependency
367 exists between two units (e.g. <filename>foo.service</filename>
368 requires <filename>bar.service</filename>), but no ordering
369 dependency (e.g. <filename>foo.service</filename> after
370 <filename>bar.service</filename>) and both are requested to start,
371 they will be started in parallel. It is a common pattern that both
372 requirement and ordering dependencies are placed between two
373 units. Also note that the majority of dependencies are implicitly
374 created and maintained by systemd. In most cases, it should be
375 unnecessary to declare additional dependencies manually, however
376 it is possible to do this.</para>
377
378 <para>Application programs and units (via dependencies) may
379 request state changes of units. In systemd, these requests are
380 encapsulated as 'jobs' and maintained in a job queue. Jobs may
381 succeed or can fail, their execution is ordered based on the
382 ordering dependencies of the units they have been scheduled
383 for.</para>
384
385 <para>On boot systemd activates the target unit
386 <filename>default.target</filename> whose job is to activate
387 on-boot services and other on-boot units by pulling them in via
388 dependencies. Usually, the unit name is just an alias (symlink) for
389 either <filename>graphical.target</filename> (for fully-featured
390 boots into the UI) or <filename>multi-user.target</filename> (for
391 limited console-only boots for use in embedded or server
392 environments, or similar; a subset of graphical.target). However,
393 it is at the discretion of the administrator to configure it as an
394 alias to any other target unit. See
395 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>
396 for details about these target units.</para>
397
398 <para>Processes systemd spawns are placed in individual Linux
399 control groups named after the unit which they belong to in the
400 private systemd hierarchy. (see <ulink
401 url="https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt">cgroups.txt</ulink>
402 for more information about control groups, or short "cgroups").
403 systemd uses this to effectively keep track of processes. Control
404 group information is maintained in the kernel, and is accessible
405 via the file system hierarchy (beneath
406 <filename>/sys/fs/cgroup/systemd/</filename>), or in tools such as
407 <citerefentry project='man-pages'><refentrytitle>systemd-cgls</refentrytitle><manvolnum>1</manvolnum></citerefentry>
408 or
409 <citerefentry project='man-pages'><refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum></citerefentry>
410 (<command>ps xawf -eo pid,user,cgroup,args</command> is
411 particularly useful to list all processes and the systemd units
412 they belong to.).</para>
413
414 <para>systemd is compatible with the SysV init system to a large
415 degree: SysV init scripts are supported and simply read as an
416 alternative (though limited) configuration file format. The SysV
417 <filename>/dev/initctl</filename> interface is provided, and
418 compatibility implementations of the various SysV client tools are
419 available. In addition to that, various established Unix
420 functionality such as <filename>/etc/fstab</filename> or the
421 <filename>utmp</filename> database are supported.</para>
422
423 <para>systemd has a minimal transaction system: if a unit is
424 requested to start up or shut down it will add it and all its
425 dependencies to a temporary transaction. Then, it will verify if
426 the transaction is consistent (i.e. whether the ordering of all
427 units is cycle-free). If it is not, systemd will try to fix it up,
428 and removes non-essential jobs from the transaction that might
429 remove the loop. Also, systemd tries to suppress non-essential
430 jobs in the transaction that would stop a running service. Finally
431 it is checked whether the jobs of the transaction contradict jobs
432 that have already been queued, and optionally the transaction is
433 aborted then. If all worked out and the transaction is consistent
434 and minimized in its impact it is merged with all already
435 outstanding jobs and added to the run queue. Effectively this
436 means that before executing a requested operation, systemd will
437 verify that it makes sense, fixing it if possible, and only
438 failing if it really cannot work.</para>
439
440 <para>Systemd contains native implementations of various tasks
441 that need to be executed as part of the boot process. For example,
442 it sets the hostname or configures the loopback network device. It
443 also sets up and mounts various API file systems, such as
444 <filename>/sys</filename> or <filename>/proc</filename>.</para>
445
446 <para>For more information about the concepts and
447 ideas behind systemd, please refer to the
448 <ulink url="http://0pointer.de/blog/projects/systemd.html">Original Design Document</ulink>.</para>
449
450 <para>Note that some but not all interfaces provided
451 by systemd are covered by the
452 <ulink url="http://www.freedesktop.org/wiki/Software/systemd/InterfaceStabilityPromise">Interface
453 Stability Promise</ulink>.</para>
454
455 <para>Units may be generated dynamically at boot and system
456 manager reload time, for example based on other configuration
457 files or parameters passed on the kernel command line. For details, see
458 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
459
460 <para>Systems which invoke systemd in a container or initrd
461 environment should implement the
462 <ulink url="http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface">Container Interface</ulink> or
463 <ulink url="http://www.freedesktop.org/wiki/Software/systemd/InitrdInterface">initrd Interface</ulink>
464 specifications, respectively.</para>
465 </refsect1>
466
467 <refsect1>
468 <title>Directories</title>
469
470 <variablelist>
471 <varlistentry>
472 <term>System unit directories</term>
473
474 <listitem><para>The systemd system manager reads unit
475 configuration from various directories. Packages that want to
476 install unit files shall place them in the directory returned
477 by <command>pkg-config systemd
478 --variable=systemdsystemunitdir</command>. Other directories
479 checked are <filename>/usr/local/lib/systemd/system</filename>
480 and <filename>/usr/lib/systemd/system</filename>. User
481 configuration always takes precedence. <command>pkg-config
482 systemd --variable=systemdsystemconfdir</command> returns the
483 path of the system configuration directory. Packages should
484 alter the content of these directories only with the
485 <command>enable</command> and <command>disable</command>
486 commands of the
487 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
488 tool. Full list of directories is provided in
489 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
490 </para></listitem>
491 </varlistentry>
492 </variablelist>
493
494 <variablelist>
495 <varlistentry>
496 <term>User unit directories</term>
497
498 <listitem><para>Similar rules apply for the user unit
499 directories. However, here the
500 <ulink url="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG
501 Base Directory specification</ulink> is followed to find
502 units. Applications should place their unit files in the
503 directory returned by <command>pkg-config systemd
504 --variable=systemduserunitdir</command>. Global configuration
505 is done in the directory reported by <command>pkg-config
506 systemd --variable=systemduserconfdir</command>. The
507 <command>enable</command> and <command>disable</command>
508 commands of the
509 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
510 tool can handle both global (i.e. for all users) and private
511 (for one user) enabling/disabling of units. Full list of
512 directories is provided in
513 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
514 </para></listitem>
515 </varlistentry>
516 </variablelist>
517
518 <variablelist>
519 <varlistentry>
520 <term>SysV init scripts directory</term>
521
522 <listitem><para>The location of the SysV init script directory
523 varies between distributions. If systemd cannot find a native
524 unit file for a requested service, it will look for a SysV
525 init script of the same name (with the
526 <filename>.service</filename> suffix
527 removed).</para></listitem>
528 </varlistentry>
529 </variablelist>
530
531 <variablelist>
532 <varlistentry>
533 <term>SysV runlevel link farm directory</term>
534
535 <listitem><para>The location of the SysV runlevel link farm
536 directory varies between distributions. systemd will take the
537 link farm into account when figuring out whether a service
538 shall be enabled. Note that a service unit with a native unit
539 configuration file cannot be started by activating it in the
540 SysV runlevel link farm.</para></listitem>
541 </varlistentry>
542 </variablelist>
543 </refsect1>
544
545 <refsect1>
546 <title>Signals</title>
547
548 <variablelist>
549 <varlistentry>
550 <term><constant>SIGTERM</constant></term>
551
552 <listitem><para>Upon receiving this signal the systemd system
553 manager serializes its state, reexecutes itself and
554 deserializes the saved state again. This is mostly equivalent
555 to <command>systemctl daemon-reexec</command>.</para>
556
557 <para>systemd user managers will start the
558 <filename>exit.target</filename> unit when this signal is
559 received. This is mostly equivalent to <command>systemctl
560 --user start exit.target</command>.</para></listitem>
561 </varlistentry>
562
563 <varlistentry>
564 <term><constant>SIGINT</constant></term>
565
566 <listitem><para>Upon receiving this signal the systemd system
567 manager will start the
568 <filename>ctrl-alt-del.target</filename> unit. This is mostly
569 equivalent to <command>systemctl start
570 ctl-alt-del.target</command>. If this signal is received more
571 than 7 times per 2s, an immediate reboot is triggered.
572 Note that pressing Ctrl-Alt-Del on the console will trigger
573 this signal. Hence, if a reboot is hanging, pressing
574 Ctrl-Alt-Del more than 7 times in 2s is a relatively safe way
575 to trigger an immediate reboot.</para>
576
577 <para>systemd user managers treat this signal the same way as
578 <constant>SIGTERM</constant>.</para></listitem>
579 </varlistentry>
580
581 <varlistentry>
582 <term><constant>SIGWINCH</constant></term>
583
584 <listitem><para>When this signal is received the systemd
585 system manager will start the
586 <filename>kbrequest.target</filename> unit. This is mostly
587 equivalent to <command>systemctl start
588 kbrequest.target</command>.</para>
589
590 <para>This signal is ignored by systemd user
591 managers.</para></listitem>
592 </varlistentry>
593
594 <varlistentry>
595 <term><constant>SIGPWR</constant></term>
596
597 <listitem><para>When this signal is received the systemd
598 manager will start the <filename>sigpwr.target</filename>
599 unit. This is mostly equivalent to <command>systemctl start
600 sigpwr.target</command>.</para></listitem>
601 </varlistentry>
602
603 <varlistentry>
604 <term><constant>SIGUSR1</constant></term>
605
606 <listitem><para>When this signal is received the systemd
607 manager will try to reconnect to the D-Bus
608 bus.</para></listitem>
609 </varlistentry>
610
611 <varlistentry>
612 <term><constant>SIGUSR2</constant></term>
613
614 <listitem><para>When this signal is received the systemd
615 manager will log its complete state in human-readable form.
616 The data logged is the same as printed by
617 <command>systemd-analyze dump</command>.</para></listitem>
618 </varlistentry>
619
620 <varlistentry>
621 <term><constant>SIGHUP</constant></term>
622
623 <listitem><para>Reloads the complete daemon configuration.
624 This is mostly equivalent to <command>systemctl
625 daemon-reload</command>.</para></listitem>
626 </varlistentry>
627
628 <varlistentry>
629 <term><constant>SIGRTMIN+0</constant></term>
630
631 <listitem><para>Enters default mode, starts the
632 <filename>default.target</filename> unit. This is mostly
633 equivalent to <command>systemctl start
634 default.target</command>.</para></listitem>
635 </varlistentry>
636
637 <varlistentry>
638 <term><constant>SIGRTMIN+1</constant></term>
639
640 <listitem><para>Enters rescue mode, starts the
641 <filename>rescue.target</filename> unit. This is mostly
642 equivalent to <command>systemctl isolate
643 rescue.target</command>.</para></listitem>
644 </varlistentry>
645
646 <varlistentry>
647 <term><constant>SIGRTMIN+2</constant></term>
648
649 <listitem><para>Enters emergency mode, starts the
650 <filename>emergency.service</filename> unit. This is mostly
651 equivalent to <command>systemctl isolate
652 emergency.service</command>.</para></listitem>
653 </varlistentry>
654
655 <varlistentry>
656 <term><constant>SIGRTMIN+3</constant></term>
657
658 <listitem><para>Halts the machine, starts the
659 <filename>halt.target</filename> unit. This is mostly
660 equivalent to <command>systemctl start
661 halt.target</command>.</para></listitem>
662 </varlistentry>
663
664 <varlistentry>
665 <term><constant>SIGRTMIN+4</constant></term>
666
667 <listitem><para>Powers off the machine, starts the
668 <filename>poweroff.target</filename> unit. This is mostly
669 equivalent to <command>systemctl start
670 poweroff.target</command>.</para></listitem>
671 </varlistentry>
672
673 <varlistentry>
674 <term><constant>SIGRTMIN+5</constant></term>
675
676 <listitem><para>Reboots the machine, starts the
677 <filename>reboot.target</filename> unit. This is mostly
678 equivalent to <command>systemctl start
679 reboot.target</command>.</para></listitem>
680 </varlistentry>
681
682 <varlistentry>
683 <term><constant>SIGRTMIN+6</constant></term>
684
685 <listitem><para>Reboots the machine via kexec, starts the
686 <filename>kexec.target</filename> unit. This is mostly
687 equivalent to <command>systemctl start
688 kexec.target</command>.</para></listitem>
689 </varlistentry>
690
691 <varlistentry>
692 <term><constant>SIGRTMIN+13</constant></term>
693
694 <listitem><para>Immediately halts the machine.</para></listitem>
695 </varlistentry>
696
697 <varlistentry>
698 <term><constant>SIGRTMIN+14</constant></term>
699
700 <listitem><para>Immediately powers off the machine.</para></listitem>
701 </varlistentry>
702
703 <varlistentry>
704 <term><constant>SIGRTMIN+15</constant></term>
705
706 <listitem><para>Immediately reboots the machine.</para></listitem>
707 </varlistentry>
708
709 <varlistentry>
710 <term><constant>SIGRTMIN+16</constant></term>
711
712 <listitem><para>Immediately reboots the machine with kexec.</para></listitem>
713 </varlistentry>
714
715 <varlistentry>
716 <term><constant>SIGRTMIN+20</constant></term>
717
718 <listitem><para>Enables display of status messages on the
719 console, as controlled via
720 <varname>systemd.show_status=1</varname> on the kernel command
721 line.</para></listitem>
722 </varlistentry>
723
724 <varlistentry>
725 <term><constant>SIGRTMIN+21</constant></term>
726
727 <listitem><para>Disables display of
728 status messages on the console, as
729 controlled via
730 <varname>systemd.show_status=0</varname>
731 on the kernel command
732 line.</para></listitem>
733 </varlistentry>
734
735 <varlistentry>
736 <term><constant>SIGRTMIN+22</constant></term>
737 <term><constant>SIGRTMIN+23</constant></term>
738
739 <listitem><para>Sets the log level to <literal>debug</literal>
740 (or <literal>info</literal> on
741 <constant>SIGRTMIN+23</constant>), as controlled via
742 <varname>systemd.log_level=debug</varname> (or
743 <varname>systemd.log_level=info</varname> on
744 <constant>SIGRTMIN+23</constant>) on the kernel command
745 line.</para></listitem>
746 </varlistentry>
747
748 <varlistentry>
749 <term><constant>SIGRTMIN+24</constant></term>
750
751 <listitem><para>Immediately exits the manager (only available
752 for --user instances).</para></listitem>
753 </varlistentry>
754
755 <varlistentry>
756 <term><constant>SIGRTMIN+26</constant></term>
757 <term><constant>SIGRTMIN+27</constant></term>
758 <term><constant>SIGRTMIN+28</constant></term>
759
760 <listitem><para>Sets the log level to
761 <literal>journal-or-kmsg</literal> (or
762 <literal>console</literal> on
763 <constant>SIGRTMIN+27</constant>, <literal>kmsg</literal> on
764 <constant>SIGRTMIN+28</constant>), as controlled via
765 <varname>systemd.log_target=journal-or-kmsg</varname> (or
766 <varname>systemd.log_target=console</varname> on
767 <constant>SIGRTMIN+27</constant> or
768 <varname>systemd.log_target=kmsg</varname> on
769 <constant>SIGRTMIN+28</constant>) on the kernel command
770 line.</para></listitem>
771 </varlistentry>
772 </variablelist>
773 </refsect1>
774
775 <refsect1>
776 <title>Environment</title>
777
778 <variablelist class='environment-variables'>
779 <varlistentry>
780 <term><varname>$SYSTEMD_LOG_LEVEL</varname></term>
781 <listitem><para>systemd reads the log level from this
782 environment variable. This can be overridden with
783 <option>--log-level=</option>.</para></listitem>
784 </varlistentry>
785
786 <varlistentry>
787 <term><varname>$SYSTEMD_LOG_TARGET</varname></term>
788 <listitem><para>systemd reads the log target from this
789 environment variable. This can be overridden with
790 <option>--log-target=</option>.</para></listitem>
791 </varlistentry>
792
793 <varlistentry>
794 <term><varname>$SYSTEMD_LOG_COLOR</varname></term>
795 <listitem><para>Controls whether systemd highlights important
796 log messages. This can be overridden with
797 <option>--log-color=</option>.</para></listitem>
798 </varlistentry>
799
800 <varlistentry>
801 <term><varname>$SYSTEMD_LOG_LOCATION</varname></term>
802 <listitem><para>Controls whether systemd prints the code
803 location along with log messages. This can be overridden with
804 <option>--log-location=</option>.</para></listitem>
805 </varlistentry>
806
807 <varlistentry>
808 <term><varname>$XDG_CONFIG_HOME</varname></term>
809 <term><varname>$XDG_CONFIG_DIRS</varname></term>
810 <term><varname>$XDG_DATA_HOME</varname></term>
811 <term><varname>$XDG_DATA_DIRS</varname></term>
812
813 <listitem><para>The systemd user manager uses these variables
814 in accordance to the <ulink
815 url="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG
816 Base Directory specification</ulink> to find its
817 configuration.</para></listitem>
818 </varlistentry>
819
820 <varlistentry>
821 <term><varname>$SYSTEMD_UNIT_PATH</varname></term>
822
823 <listitem><para>Controls where systemd looks for unit
824 files.</para></listitem>
825 </varlistentry>
826
827 <varlistentry>
828 <term><varname>$SYSTEMD_SYSVINIT_PATH</varname></term>
829
830 <listitem><para>Controls where systemd looks for SysV init
831 scripts.</para></listitem>
832 </varlistentry>
833
834 <varlistentry>
835 <term><varname>$SYSTEMD_SYSVRCND_PATH</varname></term>
836
837 <listitem><para>Controls where systemd looks for SysV init
838 script runlevel link farms.</para></listitem>
839 </varlistentry>
840
841 <varlistentry>
842 <term><varname>$SYSTEMD_COLORS</varname></term>
843
844 <listitem><para>The value must be a boolean. Controls whether colorized output should be
845 generated. This can be specified to override the decision that <command>systemd</command>
846 makes based on <varname>$TERM</varname> and what the console is connected to.</para>
847 </listitem>
848 </varlistentry>
849
850 <varlistentry>
851 <term><varname>$LISTEN_PID</varname></term>
852 <term><varname>$LISTEN_FDS</varname></term>
853 <term><varname>$LISTEN_FDNAMES</varname></term>
854
855 <listitem><para>Set by systemd for supervised processes during
856 socket-based activation. See
857 <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>
858 for more information.</para></listitem>
859 </varlistentry>
860
861 <varlistentry>
862 <term><varname>$NOTIFY_SOCKET</varname></term>
863
864 <listitem><para>Set by systemd for supervised processes for
865 status and start-up completion notification. See
866 <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>
867 for more information.</para></listitem>
868 </varlistentry>
869 </variablelist>
870 </refsect1>
871
872 <refsect1>
873 <title>Kernel Command Line</title>
874
875 <para>When run as system instance systemd parses a number of
876 kernel command line arguments<footnote><para>If run inside a Linux
877 container these arguments may be passed as command line arguments
878 to systemd itself, next to any of the command line options listed
879 in the Options section above. If run outside of Linux containers,
880 these arguments are parsed from <filename>/proc/cmdline</filename>
881 instead.</para></footnote>:</para>
882
883 <variablelist class='kernel-commandline-options'>
884 <varlistentry>
885 <term><varname>systemd.unit=</varname></term>
886 <term><varname>rd.systemd.unit=</varname></term>
887
888 <listitem><para>Overrides the unit to activate on boot.
889 Defaults to <filename>default.target</filename>. This may be
890 used to temporarily boot into a different boot unit, for
891 example <filename>rescue.target</filename> or
892 <filename>emergency.service</filename>. See
893 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>
894 for details about these units. The option prefixed with
895 <literal>rd.</literal> is honored only in the initial RAM disk
896 (initrd), while the one that is not prefixed only in the main
897 system.</para></listitem>
898 </varlistentry>
899
900 <varlistentry>
901 <term><varname>systemd.dump_core=</varname></term>
902
903 <listitem><para>Takes a boolean argument. If
904 <option>yes</option>, the systemd manager (PID 1) dumps core
905 when it crashes. Otherwise, no core dump is created. Defaults
906 to <option>yes</option>.</para></listitem>
907 </varlistentry>
908
909 <varlistentry>
910 <term><varname>systemd.crash_chvt=</varname></term>
911
912 <listitem><para>Takes a positive integer, or a boolean
913 argument. If a positive integer (in the range 163) is
914 specified, the system manager (PID 1) will activate the specified
915 virtual terminal (VT) when it crashes. Defaults to
916 <constant>no</constant>, meaning that no such switch is
917 attempted. If set to <constant>yes</constant>, the VT the
918 kernel messages are written to is selected.</para></listitem>
919 </varlistentry>
920
921 <varlistentry>
922 <term><varname>systemd.crash_shell=</varname></term>
923
924 <listitem><para>Takes a boolean argument. If
925 <option>yes</option>, the system manager (PID 1) spawns a
926 shell when it crashes, after a 10s delay. Otherwise, no shell
927 is spawned. Defaults to <option>no</option>, for security
928 reasons, as the shell is not protected by password
929 authentication.</para></listitem>
930 </varlistentry>
931
932 <varlistentry>
933 <term><varname>systemd.crash_reboot=</varname></term>
934
935 <listitem><para>Takes a boolean argument. If
936 <option>yes</option>, the system manager (PID 1) will reboot
937 the machine automatically when it crashes, after a 10s delay.
938 Otherwise, the system will hang indefinitely. Defaults to
939 <option>no</option>, in order to avoid a reboot loop. If
940 combined with <varname>systemd.crash_shell=</varname>, the
941 system is rebooted after the shell exits.</para></listitem>
942 </varlistentry>
943
944 <varlistentry>
945 <term><varname>systemd.confirm_spawn=</varname></term>
946
947 <listitem><para>Takes a boolean argument or a path to the
948 virtual console where the confirmation messages should be
949 emitted. If <option>yes</option>, the system manager (PID 1)
950 asks for confirmation when spawning processes using
951 <option>/dev/console</option>. If a path or a console name
952 (such as <literal>ttyS0</literal>) is provided, the virtual
953 console pointed to by this path or described by the give name
954 will be used instead. Defaults to <option>no</option>.</para></listitem>
955 </varlistentry>
956
957 <varlistentry>
958 <term><varname>systemd.show_status=</varname></term>
959
960 <listitem><para>Takes a boolean argument or the constant <constant>auto</constant>. If <option>yes</option>,
961 the systemd manager (PID 1) shows terse service status updates on the console during bootup.
962 <constant>auto</constant> behaves like <option>false</option> until a unit fails or there is a significant
963 delay in boot. Defaults to <option>yes</option>, unless <option>quiet</option> is passed as kernel command
964 line option, in which case it defaults to <constant>auto</constant>. If specified overrides the system manager
965 configuration file option <option>ShowStatus=</option>, see
966 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. However,
967 the process command line option <option>--show-status=</option> takes precedence over both this kernel command
968 line option and the configuration file option.</para></listitem>
969 </varlistentry>
970
971 <varlistentry>
972 <term><varname>systemd.log_target=</varname></term>
973 <term><varname>systemd.log_level=</varname></term>
974 <term><varname>systemd.log_color=</varname></term>
975 <term><varname>systemd.log_location=</varname></term>
976
977 <listitem><para>Controls log output, with the same effect as
978 the <varname>$SYSTEMD_LOG_TARGET</varname>,
979 <varname>$SYSTEMD_LOG_LEVEL</varname>,
980 <varname>$SYSTEMD_LOG_COLOR</varname>,
981 <varname>$SYSTEMD_LOG_LOCATION</varname> environment variables
982 described above.</para></listitem>
983 </varlistentry>
984
985 <varlistentry>
986 <term><varname>systemd.default_standard_output=</varname></term>
987 <term><varname>systemd.default_standard_error=</varname></term>
988 <listitem><para>Controls default standard output and error
989 output for services, with the same effect as the
990 <option>--default-standard-output=</option> and
991 <option>--default-standard-error=</option> command line
992 arguments described above, respectively.</para></listitem>
993 </varlistentry>
994
995 <varlistentry>
996 <term><varname>systemd.setenv=</varname></term>
997
998 <listitem><para>Takes a string argument in the form
999 VARIABLE=VALUE. May be used to set default environment
1000 variables to add to forked child processes. May be used more
1001 than once to set multiple variables.</para></listitem>
1002 </varlistentry>
1003
1004 <varlistentry>
1005 <term><varname>systemd.machine_id=</varname></term>
1006
1007 <listitem><para>Takes a 32 character hex value to be
1008 used for setting the machine-id. Intended mostly for
1009 network booting where the same machine-id is desired
1010 for every boot.</para></listitem>
1011 </varlistentry>
1012
1013 <varlistentry>
1014 <term><varname>quiet</varname></term>
1015
1016 <listitem><para>Turn off status output at boot, much like
1017 <varname>systemd.show_status=false</varname> would. Note that
1018 this option is also read by the kernel itself and disables
1019 kernel log output. Passing this option hence turns off the
1020 usual output from both the system manager and the kernel.
1021 </para></listitem>
1022 </varlistentry>
1023
1024 <varlistentry>
1025 <term><varname>debug</varname></term>
1026
1027 <listitem><para>Turn on debugging output. This is equivalent
1028 to <varname>systemd.log_level=debug</varname>. Note that this
1029 option is also read by the kernel itself and enables kernel
1030 debug output. Passing this option hence turns on the debug
1031 output from both the system manager and the
1032 kernel.</para></listitem>
1033 </varlistentry>
1034
1035 <varlistentry>
1036 <term><varname>emergency</varname></term>
1037 <term><varname>rd.emergency</varname></term>
1038 <term><varname>-b</varname></term>
1039
1040 <listitem><para>Boot into emergency mode. This is equivalent
1041 to <varname>systemd.unit=emergency.target</varname> or
1042 <varname>rd.systemd.unit=emergency.target</varname>, respectively, and
1043 provided for compatibility reasons and to be easier to type.</para></listitem>
1044 </varlistentry>
1045
1046 <varlistentry>
1047 <term><varname>rescue</varname></term>
1048 <term><varname>rd.rescue</varname></term>
1049 <term><varname>single</varname></term>
1050 <term><varname>s</varname></term>
1051 <term><varname>S</varname></term>
1052 <term><varname>1</varname></term>
1053
1054 <listitem><para>Boot into rescue mode. This is equivalent to
1055 <varname>systemd.unit=rescue.target</varname> or
1056 <varname>rd.systemd.unit=rescue.target</varname>, respectively, and
1057 provided for compatibility reasons and to be easier to type.</para></listitem>
1058 </varlistentry>
1059
1060 <varlistentry>
1061 <term><varname>2</varname></term>
1062 <term><varname>3</varname></term>
1063 <term><varname>4</varname></term>
1064 <term><varname>5</varname></term>
1065
1066 <listitem><para>Boot into the specified legacy SysV runlevel.
1067 These are equivalent to
1068 <varname>systemd.unit=runlevel2.target</varname>,
1069 <varname>systemd.unit=runlevel3.target</varname>,
1070 <varname>systemd.unit=runlevel4.target</varname>, and
1071 <varname>systemd.unit=runlevel5.target</varname>,
1072 respectively, and provided for compatibility reasons and to be
1073 easier to type.</para></listitem>
1074 </varlistentry>
1075
1076 <varlistentry>
1077 <term><varname>locale.LANG=</varname></term>
1078 <term><varname>locale.LANGUAGE=</varname></term>
1079 <term><varname>locale.LC_CTYPE=</varname></term>
1080 <term><varname>locale.LC_NUMERIC=</varname></term>
1081 <term><varname>locale.LC_TIME=</varname></term>
1082 <term><varname>locale.LC_COLLATE=</varname></term>
1083 <term><varname>locale.LC_MONETARY=</varname></term>
1084 <term><varname>locale.LC_MESSAGES=</varname></term>
1085 <term><varname>locale.LC_PAPER=</varname></term>
1086 <term><varname>locale.LC_NAME=</varname></term>
1087 <term><varname>locale.LC_ADDRESS=</varname></term>
1088 <term><varname>locale.LC_TELEPHONE=</varname></term>
1089 <term><varname>locale.LC_MEASUREMENT=</varname></term>
1090 <term><varname>locale.LC_IDENTIFICATION=</varname></term>
1091
1092 <listitem><para>Set the system locale to use. This overrides
1093 the settings in <filename>/etc/locale.conf</filename>. For
1094 more information, see
1095 <citerefentry project='man-pages'><refentrytitle>locale.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1096 and
1097 <citerefentry project='man-pages'><refentrytitle>locale</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
1098 </para></listitem>
1099 </varlistentry>
1100 </variablelist>
1101
1102 <para>For other kernel command line parameters understood by
1103 components of the core OS, please refer to
1104 <citerefentry><refentrytitle>kernel-command-line</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
1105 </refsect1>
1106
1107 <refsect1>
1108 <title>Sockets and FIFOs</title>
1109
1110 <variablelist>
1111 <varlistentry>
1112 <term><filename>/run/systemd/notify</filename></term>
1113
1114 <listitem><para>Daemon status notification socket. This is an
1115 <constant>AF_UNIX</constant> datagram socket and is used to
1116 implement the daemon notification logic as implemented by
1117 <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
1118
1119 </varlistentry>
1120
1121 <varlistentry>
1122 <term><filename>/run/systemd/private</filename></term>
1123
1124 <listitem><para>Used internally as communication channel
1125 between
1126 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1127 and the systemd process. This is an
1128 <constant>AF_UNIX</constant> stream socket. This interface is
1129 private to systemd and should not be used in external
1130 projects.</para></listitem>
1131 </varlistentry>
1132
1133 <varlistentry>
1134 <term><filename>/dev/initctl</filename></term>
1135
1136 <listitem><para>Limited compatibility support for the SysV
1137 client interface, as implemented by the
1138 <filename>systemd-initctl.service</filename> unit. This is a
1139 named pipe in the file system. This interface is obsolete and
1140 should not be used in new applications.</para></listitem>
1141 </varlistentry>
1142 </variablelist>
1143 </refsect1>
1144
1145 <refsect1>
1146 <title>See Also</title>
1147 <para>
1148 The <ulink url="http://www.freedesktop.org/wiki/Software/systemd/">systemd Homepage</ulink>,
1149 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1150 <citerefentry project='man-pages'><refentrytitle>locale.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1151 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1152 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1153 <citerefentry><refentrytitle>systemd-notify</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1154 <citerefentry><refentrytitle>daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1155 <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
1156 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1157 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1158 <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1159 <citerefentry><refentrytitle>kernel-command-line</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1160 <citerefentry project='man-pages'><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1161 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1162 </para>
1163 </refsect1>
1164
1165 </refentry>