3
.\" Author: Lennart Poettering <lennart@poettering.net>
4
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
10
.TH "SYSTEMD" "1" "03/16/2012" "systemd" "systemd"
11
.\" -----------------------------------------------------------------
12
.\" * Define some portability stuff
13
.\" -----------------------------------------------------------------
14
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
.\" http://bugs.debian.org/507673
16
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20
.\" -----------------------------------------------------------------
21
.\" * set default formatting
22
.\" -----------------------------------------------------------------
23
.\" disable hyphenation
25
.\" disable justification (adjust text to left margin only)
27
.\" -----------------------------------------------------------------
28
.\" * MAIN CONTENT STARTS HERE *
29
.\" -----------------------------------------------------------------
31
systemd, init \- systemd System and Service Manager
33
.HP \w'\fBsystemd\ \fR\fB[OPTIONS...]\fR\ 'u
34
\fBsystemd \fR\fB[OPTIONS...]\fR
35
.HP \w'\fBinit\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB{COMMAND}\fR\ 'u
36
\fBinit \fR\fB[OPTIONS...]\fR\fB \fR\fB{COMMAND}\fR
39
systemd is a system and service manager for Linux operating systems\&. When run as first process on boot (as PID 1), it acts as init system that brings up and maintains userspace services\&.
41
For compatibility with SysV, if systemd is called as
43
and a PID that is not 1, it will execute
45
and pass all command line arguments unmodified\&. That means
49
are mostly equivalent when invoked from normal login sessions\&. See
51
for more information\&.
53
When run as system instance, systemd interprets the configuration file
54
system\&.conf, otherwise
57
for more information\&.
60
The following options are understood:
62
\fB\-h\fR, \fB\-\-help\fR
64
Prints a short help text and exits\&.
69
Determine startup sequence, dump it and exit\&. This is an option useful for debugging only\&.
72
\fB\-\-dump\-configuration\-items\fR
74
Dump understood unit configuration items\&. This outputs a terse but complete list of configuration items understood in unit definition files\&.
79
Extract D\-Bus interface introspection data\&. This is mostly useful at install time to generate data suitable for the D\-Bus interfaces repository\&. Optionally the interface name for the introspection data may be specified\&. If omitted, the introspection data for all interfaces is dumped\&.
84
Set default unit to activate on startup\&. If not specified defaults to
88
\fB\-\-system\fR, \fB\-\-user\fR
90
Tell systemd to run a system instance (resp\&. user instance), even if the process ID is not 1 (resp\&. is 1), i\&.e\&. systemd is not (resp\&. is) run as init process\&. Normally it should not be necessary to pass these options, as systemd automatically detects the mode it is started in\&. These options are hence of little use except for debugging\&. Note that it is not supported booting and maintaining a full system with systemd running in
92
mode, but PID not 1\&. In practice, passing
94
explicitly is only useful in conjunction with
100
Dump core on crash\&. This switch has no effect when run as user instance\&.
103
\fB\-\-crash\-shell\fR
105
Run shell on crash\&. This switch has no effect when run as user instance\&.
108
\fB\-\-confirm\-spawn\fR
110
Ask for confirmation when spawning processes\&. This switch has no effect when run as user instance\&.
113
\fB\-\-show\-status=\fR
115
Show terse service status information while booting\&. This switch has no effect when run as user instance\&. Takes a boolean argument which may be omitted which is interpreted as
119
\fB\-\-sysv\-console=\fR
121
Controls whether output of SysV init scripts will be directed to the console\&. This switch has no effect when run as user instance\&. Takes a boolean argument which may be omitted which is interpreted as
125
\fB\-\-log\-target=\fR
127
Set log target\&. Argument must be one of
132
\fBjournal\-or\-kmsg\fR,
133
\fBsyslog\-or\-kmsg\fR,
137
\fB\-\-log\-level=\fR
139
Set log level\&. As argument this accepts a numerical log level or the well\-known
141
symbolic names (lowercase):
152
\fB\-\-log\-color=\fR
154
Highlight important log messages\&. Argument is a boolean value\&. If the argument is omitted it defaults to
158
\fB\-\-log\-location=\fR
160
Include code location in log messages\&. This is mostly relevant for debugging purposes\&. Argument is a boolean value\&. If the argument is omitted it defaults to
164
\fB\-\-default\-standard\-output=\fR, \fB\-\-default\-standard\-error=\fR
166
Sets the default output resp\&. error output for all services and sockets, i\&.e\&. controls the default for
167
\fBStandardOutput=\fR
171
\fBsystemd.exec\fR(5)
172
for details)\&. Takes one of
177
\fBjournal+console\fR,
179
\fBsyslog+console\fR,
181
\fBkmsg+console\fR\&. If the argument is omitted
182
\fB\-\-default\-standard\-output=\fR
186
\fB\-\-default\-standard\-error=\fR
192
systemd provides a dependency system between various entities called "units"\&. Units encapsulate various objects that are relevant for system boot\-up and maintenance\&. The majority of units are configured in unit configuration files, whose syntax and basic set of options is described in
193
\fBsystemd.unit\fR(5), however some are created automatically from other configuration or dynamically from system state\&. Units may be \*(Aqactive\*(Aq (meaning started, bound, plugged in, \&.\&.\&. depending on the unit type, see below), or \*(Aqinactive\*(Aq (meaning stopped, unbound, unplugged, \&.\&.\&.), as well as in the process of being activated or deactivated, i\&.e\&. between the two states (these states are called \*(Aqactivating\*(Aq, \*(Aqdeactivating\*(Aq)\&. A special \*(Aqfailed\*(Aq state is available as well which is very similar to \*(Aqinactive\*(Aq and is entered when the service failed in some way (process returned error code on exit, or crashed, or an operation timed out)\&. If this state is entered the cause will be logged, for later reference\&. Note that the various unit types may have a number of additional substates, which are mapped to the five generalized unit states described here\&.
195
The following unit types are available:
205
Service units, which control daemons and the processes they consist of\&. For details see
206
\fBsystemd.service\fR(5)\&.
217
Socket units, which encapsulate local IPC or network sockets in the system, useful for socket\-based activation\&. For details about socket units see
218
\fBsystemd.socket\fR(5), for details on socket\-based activation and other forms of activation, see
230
Target units are useful to group units, or provide well\-known synchronization points during boot\-up, see
231
\fBsystemd.target\fR(5)\&.
242
Device units expose kernel devices in systemd and may be used to implement device\-based activation\&. For details see
243
\fBsystemd.device\fR(5)\&.
254
Mount units control mount points in the file system, for details see
255
\fBsystemd.mount\fR(5)\&.
266
Automount units provide automount capabilities, for on\-demand mounting of file systems as well as parallelized boot\-up\&. See
267
\fBsystemd.automount\fR(5)\&.
278
Snapshot units can be used to temporarily save the state of the set of systemd units, which later may be restored by activating the saved snapshot unit\&. For more information see
279
\fBsystemd.snapshot\fR(5)\&.
290
Timer units are useful for triggering activation of other units based on timers\&. You may find details in
291
\fBsystemd.timer\fR(5)\&.
302
Swap units are very similar to mount units and encapsulate memory swap partitions or files of the operating system\&. They are described in
303
\fBsystemd.swap\fR(5)\&.
314
Path units may be used to activate other services when file system objects change or are modified\&. See
315
\fBsystemd.path\fR(5)\&.
318
Units are named as their configuration files\&. Some units have special semantics\&. A detailed list is available in
319
\fBsystemd.special\fR(7)\&.
321
systemd knows various kinds of dependencies, including positive and negative requirement dependencies (i\&.e\&.
324
\fIConflicts=\fR) as well as ordering dependencies (\fIAfter=\fR
326
\fIBefore=\fR)\&. NB: ordering and requirement dependencies are orthogonal\&. If only a requirement dependency exists between two units (e\&.g\&.
329
bar\&.service), but no ordering dependency (e\&.g\&.
332
bar\&.service) and both are requested to start, they will be started in parallel\&. It is a common pattern that both requirement and ordering dependencies are placed between two units\&. Also note that the majority of dependencies are implicitly created and maintained by systemd\&. In most cases it should be unnecessary to declare additional dependencies manually, however it is possible to do this\&.
334
Application programs and units (via dependencies) may request state changes of units\&. In systemd, these requests are encapsulated as \*(Aqjobs\*(Aq and maintained in a job queue\&. Jobs may succeed or can fail, their execution is ordered based on the ordering dependencies of the units they have been scheduled for\&.
336
On boot systemd activates the target unit
338
whose job is to activate on\-boot services and other on\-boot units by pulling them in via dependencies\&. Usually the unit name is just an alias (symlink) for either
340
(for fully\-featured boots into the UI) or
342
(for limited console\-only boots for use in embedded or server environments, or similar; a subset of graphical\&.target)\&. However it is at the discretion of the administrator to configure it as an alias to any other target unit\&. See
343
\fBsystemd.special\fR(7)
344
for details about these target units\&.
346
Processes systemd spawns are placed in individual Linux control groups named after the unit which they belong to in the private systemd hierarchy\&. (see
347
\m[blue]\fBcgroups\&.txt\fR\m[]\&\s-2\u[1]\d\s+2
348
for more information about control groups, or short "cgroups")\&. systemd uses this to effectively keep track of processes\&. Control group information is maintained in the kernel, and is accessible via the file system hierarchy (beneath
349
/sys/fs/cgroup/systemd/), or in tools such as
351
(\fBps xawf \-eo pid,user,cgroup,args\fR
352
is particularly useful to list all processes and the systemd units they belong to\&.)\&.
354
systemd is compatible with the SysV init system to a large degree: SysV init scripts are supported and simply read as an alternative (though limited) configuration file format\&. The SysV
356
interface is provided, and compatibility implementations of the various SysV client tools are available\&. In addition to that, various established Unix functionality such as
360
database are supported\&.
362
systemd has a minimal transaction system: if a unit is requested to start up or shut down it will add it and all its dependencies to a temporary transaction\&. Then, it will verify if the transaction is consistent (i\&.e\&. whether the ordering of all units is cycle\-free)\&. If it is not, systemd will try to fix it up, and removes non\-essential jobs from the transaction that might remove the loop\&. Also, systemd tries to suppress non\-essential jobs in the transaction that would stop a running service\&. Finally it is checked whether the jobs of the transaction contradict jobs that have already been queued, and optionally the transaction is aborted then\&. If all worked out and the transaction is consistent and minimized in its impact it is merged with all already outstanding jobs and added to the run queue\&. Effectively this means that before executing a requested operation, systemd will verify that it makes sense, fixing it if possible, and only failing if it really cannot work\&.
364
Systemd contains native implementations of various tasks that need to be executed as part of the boot process\&. For example, it sets the host name or configures the loopback network device\&. It also sets up and mounts various API file systems, such as
369
For more information about the concepts and ideas behind systemd please refer to the
370
\m[blue]\fBOriginal Design Document\fR\m[]\&\s-2\u[2]\d\s+2\&.
372
Note that some but not all interfaces provided by systemd are covered by the
373
\m[blue]\fBInterface Stability Promise\fR\m[]\&\s-2\u[3]\d\s+2\&.
376
System unit directories
378
The systemd system manager reads unit configuration from various directories\&. Packages that want to install unit files shall place them in the directory returned by
379
\fBpkg\-config systemd \-\-variable=systemdsystemunitdir\fR\&. Other directories checked are
380
/usr/local/lib/systemd/system
382
/usr/lib/systemd/system\&. User configuration always takes precedence\&.
383
\fBpkg\-config systemd \-\-variable=systemdsystemconfdir\fR
384
returns the path of the system configuration directory\&. Packages should alter the content of these directories only with the
393
User unit directories
395
Similar rules apply for the user unit directories\&. However, here the
396
\m[blue]\fBXDG Base Directory specification\fR\m[]\&\s-2\u[4]\d\s+2
397
is followed to find units\&. Applications should place their unit files in the directory returned by
398
\fBpkg\-config systemd \-\-variable=systemduserunitdir\fR\&. Global configuration is done in the directory reported by
399
\fBpkg\-config systemd \-\-variable=systemduserconfdir\fR\&. The
405
tool can handle both global (i\&.e\&. for all users) and private (for one user) enabling/disabling of units\&.
408
SysV init scripts directory
410
The location of the SysV init script directory varies between distributions\&. If systemd cannot find a native unit file for a requested service, it will look for a SysV init script of the same name (with the
415
SysV runlevel link farm directory
417
The location of the SysV runlevel link farm directory varies between distributions\&. systemd will take the link farm into account when figuring out whether a service shall be enabled\&. Note that a service unit with a native unit configuration file cannot be started by activating it in the SysV runlevel link farm\&.
423
Upon receiving this signal the systemd system manager serializes its state, reexecutes itself and deserializes the saved state again\&. This is mostly equivalent to
424
\fBsystemctl daemon\-reexec\fR\&.
426
systemd user managers will start the
428
unit when this signal is received\&. This is mostly equivalent to
429
\fBsystemctl \-\-user start exit\&.target\fR\&.
434
Upon receiving this signal the systemd system manager will start the
435
ctrl\-alt\-del\&.target
436
unit\&. This is mostly equivalent to
437
\fBsystemctl start ctl\-alt\-del\&.target\fR\&.
439
systemd user managers treat this signal the same way as SIGTERM\&.
444
When this signal is received the systemd system manager will start the
446
unit\&. This is mostly equivalent to
447
\fBsystemctl start kbrequest\&.target\fR\&.
449
This signal is ignored by systemd user managers\&.
454
When this signal is received the systemd manager will start the
456
unit\&. This is mostly equivalent to
457
\fBsystemctl start sigpwr\&.target\fR\&.
462
When this signal is received the systemd manager will try to reconnect to the D\-Bus bus\&.
467
When this signal is received the systemd manager will log its complete state in human readable form\&. The data logged is the same as printed by
468
\fBsystemctl dump\fR\&.
473
Reloads the complete daemon configuration\&. This is mostly equivalent to
474
\fBsystemctl daemon\-reload\fR\&.
479
Enters default mode, starts the
481
unit\&. This is mostly equivalent to
482
\fBsystemctl start default\&.target\fR\&.
487
Enters rescue mode, starts the
489
unit\&. This is mostly equivalent to
490
\fBsystemctl isolate rescue\&.target\fR\&.
495
Enters emergency mode, starts the
497
unit\&. This is mostly equivalent to
498
\fBsystemctl isolate emergency\&.service\fR\&.
503
Halts the machine, starts the
505
unit\&. This is mostly equivalent to
506
\fBsystemctl start halt\&.target\fR\&.
511
Powers off the machine, starts the
513
unit\&. This is mostly equivalent to
514
\fBsystemctl start poweroff\&.target\fR\&.
519
Reboots the machine, starts the
521
unit\&. This is mostly equivalent to
522
\fBsystemctl start reboot\&.target\fR\&.
527
Reboots the machine via kexec, starts the
529
unit\&. This is mostly equivalent to
530
\fBsystemctl start kexec\&.target\fR\&.
535
Immediately halts the machine\&.
540
Immediately powers off the machine\&.
545
Immediately reboots the machine\&.
550
Immediately reboots the machine with kexec\&.
555
Enables display of status messages on the console, as controlled via
556
\fIsystemd\&.show_status=1\fR
557
on the kernel command line\&.
562
Disables display of status messages on the console, as controlled via
563
\fIsystemd\&.show_status=0\fR
564
on the kernel command line\&.
567
SIGRTMIN+22, SIGRTMIN+23
569
Sets the log level to
574
SIGRTMIN+23), as controlled via
575
\fIsystemd\&.log_level=debug\fR
577
\fIsystemd\&.log_level=info\fR
579
SIGRTMIN+23) on the kernel command line\&.
582
SIGRTMIN+26, SIGRTMIN+27, SIGRTMIN+28, SIGRTMIN+29
584
Sets the log level to
595
SIGRTMIN+29), as controlled via
596
\fIsystemd\&.log_target=journal\-or\-kmsg\fR
598
\fIsystemd\&.log_target=console\fR
601
\fIsystemd\&.log_target=kmsg\fR
604
\fIsystemd\&.log_target=syslog\-or\-kmsg\fR
606
SIGRTMIN+29) on the kernel command line\&.
610
\fI$SYSTEMD_LOG_LEVEL\fR
612
systemd reads the log level from this environment variable\&. This can be overridden with
613
\fB\-\-log\-level=\fR\&.
616
\fI$SYSTEMD_LOG_TARGET\fR
618
systemd reads the log target from this environment variable\&. This can be overridden with
619
\fB\-\-log\-target=\fR\&.
622
\fI$SYSTEMD_LOG_COLOR\fR
624
Controls whether systemd highlights important log messages\&. This can be overridden with
625
\fB\-\-log\-color=\fR\&.
628
\fI$SYSTEMD_LOG_LOCATION\fR
630
Controls whether systemd prints the code location along with log messages\&. This can be overridden with
631
\fB\-\-log\-location=\fR\&.
634
\fI$XDG_CONFIG_HOME\fR, \fI$XDG_CONFIG_DIRS\fR, \fI$XDG_DATA_HOME\fR, \fI$XDG_DATA_DIRS\fR
636
The systemd user manager uses these variables in accordance to the
637
\m[blue]\fBXDG Base Directory specification\fR\m[]\&\s-2\u[4]\d\s+2
638
to find its configuration\&.
641
\fI$SYSTEMD_UNIT_PATH\fR
643
Controls where systemd looks for unit files\&.
646
\fI$SYSTEMD_SYSVINIT_PATH\fR
648
Controls where systemd looks for SysV init scripts\&.
651
\fI$SYSTEMD_SYSVRCND_PATH\fR
653
Controls where systemd looks for SysV init script runlevel link farms\&.
656
\fI$LISTEN_PID\fR, \fI$LISTEN_FDS\fR
658
Set by systemd for supervised processes during socket\-based activation\&. See
659
\fBsd_listen_fds\fR(3)
660
for more information\&.
665
Set by systemd for supervised processes for status and start\-up completion notification\&. See
667
for more information\&.
669
.SH "KERNEL COMMAND LINE"
671
When run as system instance systemd parses a number of kernel command line arguments\&\s-2\u[5]\d\s+2:
673
\fIsystemd\&.unit=\fR
675
Overrides the unit to activate on boot\&. Defaults to
676
default\&.target\&. This may be used to temporarily boot into a different boot unit, for example
679
emergency\&.service\&. See
680
\fBsystemd.special\fR(7)
681
for details about these units\&.
684
\fIsystemd\&.dump_core=\fR
686
Takes a boolean argument\&. If
688
systemd dumps core when it crashes\&. Otherwise no core dump is created\&. Defaults to
692
\fIsystemd\&.crash_shell=\fR
694
Takes a boolean argument\&. If
696
systemd spawns a shell when it crashes\&. Otherwise no shell is spawned\&. Defaults to
697
\fBfalse\fR, for security reasons, as the shell is not protected by any password authentication\&.
700
\fIsystemd\&.crash_chvt=\fR
702
Takes an integer argument\&. If positive systemd activates the specified virtual terminal when it crashes\&. Defaults to
706
\fIsystemd\&.confirm_spawn=\fR
708
Takes a boolean argument\&. If
710
asks for confirmation when spawning processes\&. Defaults to
714
\fIsystemd\&.show_status=\fR
716
Takes a boolean argument\&. If
718
shows terse service status updates on the console during bootup\&. Defaults to
722
\fIsystemd\&.sysv_console=\fR
724
Takes a boolean argument\&. If
726
output of SysV init scripts will be directed to the console\&. Defaults to
729
is passed as kernel command line option in which case it defaults to
733
\fIsystemd\&.log_target=\fR, \fIsystemd\&.log_level=\fR, \fIsystemd\&.log_color=\fR, \fIsystemd\&.log_location=\fR
735
Controls log output, with the same effect as the
736
\fI$SYSTEMD_LOG_TARGET\fR,
737
\fI$SYSTEMD_LOG_LEVEL\fR,
738
\fI$SYSTEMD_LOG_COLOR\fR,
739
\fI$SYSTEMD_LOG_LOCATION\fR
740
environment variables described above\&.
743
\fIsystemd\&.default_standard_output=\fR, \fIsystemd\&.default_standard_error=\fR
745
Controls default standard output/error output for services, with the same effect as the
746
\fB\-\-default\-standard\-output=\fR
748
\fB\-\-default\-standard\-error=\fR
749
command line arguments described above\&.
752
\fIsystemd\&.setenv=\fR
754
Takes a string argument in the form VARIABLE=VALUE\&. May be used to set environment variables for the init process and all its children at boot time\&. May be used more than once to set multiple variables\&. If the equal sign and variable are missing unsets an environment variable which might be passed in from the initial ram disk\&.
756
.SH "SOCKETS AND FIFOS"
760
Daemon status notification socket\&. This is an AF_UNIX datagram socket and is used to implement the daemon notification logic as implemented by
761
\fBsd_notify\fR(3)\&.
764
/run/systemd/shutdownd
766
Used internally by the
768
tool to implement delayed shutdowns\&. This is an AF_UNIX datagram socket\&.
773
Used internally as communication channel between
775
and the systemd process\&. This is an AF_UNIX stream socket\&. This interface is private to systemd and should not be used in external projects\&.
780
Limited compatibility support for the SysV client interface, as implemented by the
781
systemd\-initctl\&.service
782
unit\&. This is a named pipe in the file system\&. This interface is obsolete and should not be used in new applications\&.
789
\fBsystemd-notify\fR(1),
792
\fBsystemd.unit\fR(5),
793
\fBsystemd.special\fR(5),
797
\fBLennart Poettering\fR <\&lennart@poettering\&.net\&>
805
\%http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt
808
Original Design Document
810
\%http://0pointer.de/blog/projects/systemd.html
813
Interface Stability Promise
815
\%http://www.freedesktop.org/wiki/Software/systemd/InterfaceStabilityPromise
818
XDG Base Directory specification
820
\%http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
823
If run inside a Linux container these arguments may be passed as command line arguments to systemd itself, next to any of the command line options listed in the Options section above. If run outside of Linux containers, these arguments are parsed from