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