blob: bf010f8acf253aff697cb8466ca36a99020d6c30 [file] [log] [blame]
Lennart Poetteringd657c512012-01-25 02:20:38 +01001systemd System and Service Manager
Lennart Poettering31cee6f2010-05-13 03:30:21 +02002
3DETAILS:
4 http://0pointer.de/blog/projects/systemd.html
5
6WEB SITE:
AsciiWolf19d93722017-02-21 15:56:04 +01007 https://www.freedesktop.org/wiki/Software/systemd
Lennart Poettering31cee6f2010-05-13 03:30:21 +02008
9GIT:
Jonathan Boulleeb0914f2015-06-02 15:57:50 -070010 git@github.com:systemd/systemd.git
Jonathan Boulleeb0914f2015-06-02 15:57:50 -070011 https://github.com/systemd/systemd
Lennart Poettering31cee6f2010-05-13 03:30:21 +020012
13MAILING LIST:
AsciiWolf19d93722017-02-21 15:56:04 +010014 https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Lennart Poettering31cee6f2010-05-13 03:30:21 +020015
16IRC:
17 #systemd on irc.freenode.org
18
19BUG REPORTS:
Jonathan Boulleeb0914f2015-06-02 15:57:50 -070020 https://github.com/systemd/systemd/issues
Lennart Poettering31cee6f2010-05-13 03:30:21 +020021
22AUTHOR:
Lennart Poettering5430f7f2012-04-12 00:20:58 +020023 Lennart Poettering
24 Kay Sievers
25 ...and many others
Lennart Poettering31cee6f2010-05-13 03:30:21 +020026
Lennart Poettering673eab92011-07-14 23:53:53 +020027LICENSE:
Lennart Poettering5430f7f2012-04-12 00:20:58 +020028 LGPLv2.1+ for all code
Kay Sieversa0953152015-06-09 14:27:33 +020029 - except src/basic/MurmurHash2.c which is Public Domain
30 - except src/basic/siphash24.c which is CC0 Public Domain
Kay Sievers85424722013-08-14 22:58:21 +020031 - except src/journal/lookup3.c which is Public Domain
32 - except src/udev/* which is (currently still) GPLv2, GPLv2+
Lennart Poettering673eab92011-07-14 23:53:53 +020033
Lennart Poettering31cee6f2010-05-13 03:30:21 +020034REQUIREMENTS:
Michael Biebldcce98a2017-03-02 19:11:37 +010035 Linux kernel >= 3.13
Lennart Poetteringa0c3e162015-09-06 15:58:20 +020036 Linux kernel >= 4.2 for unified cgroup hierarchy support
Kay Sievers23aedd02014-03-22 18:27:35 +010037
38 Kernel Config Options:
Kay Sievers713bc0c2013-03-06 19:36:39 +010039 CONFIG_DEVTMPFS
Jan Engelhardtd28315e2014-05-03 19:15:23 +020040 CONFIG_CGROUPS (it is OK to disable all controllers)
Kay Sievers713bc0c2013-03-06 19:36:39 +010041 CONFIG_INOTIFY_USER
42 CONFIG_SIGNALFD
43 CONFIG_TIMERFD
44 CONFIG_EPOLL
Kay Sievers41938692013-03-06 19:51:52 +010045 CONFIG_NET
Kay Sievers713bc0c2013-03-06 19:36:39 +010046 CONFIG_SYSFS
Shawn Landden06d461e2013-12-09 07:04:06 -080047 CONFIG_PROC_FS
Kay Sievers5d319742014-02-15 17:21:49 +010048 CONFIG_FHANDLE (libudev, mount and bind mount handling)
Kay Sievers713bc0c2013-03-06 19:36:39 +010049
Mike Gilbert9c7f7d82017-02-25 22:42:27 -050050 Kernel crypto/hash API
51 CONFIG_CRYPTO_USER_API_HASH
52 CONFIG_CRYPTO_HMAC
53 CONFIG_CRYPTO_SHA256
54
Kay Sieversbe2ea722014-08-30 11:34:20 +020055 udev will fail to work with the legacy sysfs layout:
Kay Sieversf28cbd02013-03-06 20:01:45 +010056 CONFIG_SYSFS_DEPRECATED=n
Kay Sievers713bc0c2013-03-06 19:36:39 +010057
58 Legacy hotplug slows down the system and confuses udev:
59 CONFIG_UEVENT_HELPER_PATH=""
60
Kay Sieversbe2ea722014-08-30 11:34:20 +020061 Userspace firmware loading is not supported and should
62 be disabled in the kernel:
Kay Sievers713bc0c2013-03-06 19:36:39 +010063 CONFIG_FW_LOADER_USER_HELPER=n
64
65 Some udev rules and virtualization detection relies on it:
66 CONFIG_DMIID
67
Kay Sieversa5c724b2013-09-15 07:29:25 +020068 Support for some SCSI devices serial number retrieval, to
69 create additional symlinks in /dev/disk/ and /dev/tape:
70 CONFIG_BLK_DEV_BSG
71
Lennart Poettering0ca48bb2017-02-06 21:13:21 +010072 Required for PrivateNetwork= and PrivateDevices= in service units:
Mike Gilbert13468822014-03-31 14:28:23 -040073 CONFIG_NET_NS
Zbigniew Jędrzejewski-Szmekb52a4a32014-12-30 09:57:01 -050074 CONFIG_DEVPTS_MULTIPLE_INSTANCES
75 Note that systemd-localed.service and other systemd units use
76 PrivateNetwork and PrivateDevices so this is effectively required.
Mike Gilbert13468822014-03-31 14:28:23 -040077
Lennart Poettering0ca48bb2017-02-06 21:13:21 +010078 Required for PrivateUsers= in service units:
Lucas Werkmeister87fe1702017-01-24 03:18:07 +010079 CONFIG_USER_NS
80
Kay Sievers713bc0c2013-03-06 19:36:39 +010081 Optional but strongly recommended:
82 CONFIG_IPV6
83 CONFIG_AUTOFS4_FS
Kay Sievers713bc0c2013-03-06 19:36:39 +010084 CONFIG_TMPFS_XATTR
Zbigniew Jędrzejewski-Szmeka6cccd82015-03-03 09:00:39 -050085 CONFIG_{TMPFS,EXT4,XFS,BTRFS_FS,...}_POSIX_ACL
Kay Sieversf28cbd02013-03-06 20:01:45 +010086 CONFIG_SECCOMP
Felipe Satelerfd74fa72016-09-05 19:16:13 -030087 CONFIG_SECCOMP_FILTER (required for seccomp support)
Lennart Poettering3b920d72015-05-18 16:35:24 +020088 CONFIG_CHECKPOINT_RESTORE (for the kcmp() syscall)
Kay Sievers713bc0c2013-03-06 19:36:39 +010089
Lennart Poetteringf4e74be2015-07-11 14:18:35 -030090 Required for CPUShares= in resource control unit settings
Umut Tezduyar Lindskoga21b4672014-06-10 23:29:30 +020091 CONFIG_CGROUP_SCHED
92 CONFIG_FAIR_GROUP_SCHED
93
Lennart Poetteringf4e74be2015-07-11 14:18:35 -030094 Required for CPUQuota= in resource control unit settings
WaLyong Cho0acd5a02014-11-19 00:13:43 +090095 CONFIG_CFS_BANDWIDTH
96
Kay Sieversf28cbd02013-03-06 20:01:45 +010097 For UEFI systems:
Thomas Bächlerf33016f2014-03-22 01:41:12 +010098 CONFIG_EFIVAR_FS
Kay Sieversf28cbd02013-03-06 20:01:45 +010099 CONFIG_EFI_PARTITION
100
Lennart Poetteringf4e74be2015-07-11 14:18:35 -0300101 We recommend to turn off Real-Time group scheduling in the
102 kernel when using systemd. RT group scheduling effectively
103 makes RT scheduling unavailable for most userspace, since it
104 requires explicit assignment of RT budgets to each unit whose
105 processes making use of RT. As there's no sensible way to
106 assign these budgets automatically this cannot really be
107 fixed, and it's best to disable group scheduling hence.
108 CONFIG_RT_GROUP_SCHED=n
109
Lennart Poetteringf5a93d52017-07-24 11:28:04 +0200110 It's a good idea to disable the implicit creation of networking bonding
111 devices by the kernel networking bonding module, so that the
112 automatically created "bond0" interface doesn't conflict with any such
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +0100113 device created by systemd-networkd (or other tools). Ideally there
114 would be a kernel compile-time option for this, but there currently
115 isn't. The next best thing is to make this change through a modprobe.d
116 drop-in. This is shipped by default, see modprobe.d/systemd.conf.
Lennart Poetteringf5a93d52017-07-24 11:28:04 +0200117
Lennart Poettering77b6e192013-05-10 00:14:12 +0200118 Note that kernel auditing is broken when used with systemd's
119 container code. When using systemd in conjunction with
Jan Engelhardt19aadac2013-10-22 01:50:48 +0200120 containers, please make sure to either turn off auditing at
Lennart Poettering77b6e192013-05-10 00:14:12 +0200121 runtime using the kernel command line option "audit=0", or
122 turn it off at kernel compile time using:
123 CONFIG_AUDIT=n
Lennart Poetteringa7b1c392014-03-11 05:40:36 +0100124 If systemd is compiled with libseccomp support on
125 architectures which do not use socketcall() and where seccomp
126 is supported (this effectively means x86-64 and ARM, but
Jan Engelhardt70a44af2014-05-03 19:15:24 +0200127 excludes 32-bit x86!), then nspawn will now install a
Lennart Poetteringa7b1c392014-03-11 05:40:36 +0100128 work-around seccomp filter that makes containers boot even
129 with audit being enabled. This works correctly only on kernels
130 3.14 and newer though. TL;DR: turn audit off, still.
Lennart Poettering77b6e192013-05-10 00:14:12 +0200131
Łukasz Stelmach3dd26f32015-04-10 19:39:17 +0200132 glibc >= 2.16
Lennart Poettering3ede8352011-02-16 19:09:11 +0100133 libcap
Martin Pitt1d40ddb2015-11-02 10:05:20 -0600134 libmount >= 2.27.1 (from util-linux)
Zbigniew Jędrzejewski-Szmekf0892062017-05-12 04:49:48 -0400135 (util-linux < 2.29 *must* be built with --enable-libmount-force-mountinfo,
136 and later versions without --enable-libmount-support-mtab.)
hbrueckner6abfd302016-10-05 13:58:55 +0200137 libseccomp >= 2.3.1 (optional)
Gabriel de Perthuisd47f6ca2014-12-13 01:56:56 +0100138 libblkid >= 2.24 (from util-linux) (optional)
Tom Gundersena18535d2013-10-17 19:49:19 +0200139 libkmod >= 15 (optional)
Lennart Poettering3ede8352011-02-16 19:09:11 +0100140 PAM >= 1.1.2 (optional)
141 libcryptsetup (optional)
142 libaudit (optional)
Zbigniew Jędrzejewski-Szmek19d5d4c2011-07-12 13:57:48 +0200143 libacl (optional)
Lennart Poettering3ede8352011-02-16 19:09:11 +0100144 libselinux (optional)
Zbigniew Jędrzejewski-Szmek19d5d4c2011-07-12 13:57:48 +0200145 liblzma (optional)
Zbigniew Jędrzejewski-Szmeka509e0e2014-07-07 18:29:19 -0400146 liblz4 >= 119 (optional)
Lennart Poettering7b17a7d2012-09-28 00:46:32 +0200147 libgcrypt (optional)
148 libqrencode (optional)
149 libmicrohttpd (optional)
Zbigniew Jędrzejewski-Szmek2cc86f02012-11-22 15:30:50 +0100150 libpython (optional)
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -0400151 libidn2 or libidn (optional)
Lennart Poettering5b244712014-06-23 12:42:17 +0200152 elfutils >= 158 (optional)
Zbigniew Jędrzejewski-Szmek72cdb3e2017-07-02 20:21:34 -0400153 pkg-config
154 gperf >= 3.1
155 docbook-xsl (optional, required for documentation)
156 xsltproc (optional, required for documentation)
157 python-lxml (optional, required to build the indices)
158 python, meson, ninja
159 gcc, awk, sed, grep, m4, and similar tools
Lennart Poettering3ede8352011-02-16 19:09:11 +0100160
Jan Engelhardt19aadac2013-10-22 01:50:48 +0200161 During runtime, you need the following additional
162 dependencies:
Zbigniew Jędrzejewski-Szmek2cc86f02012-11-22 15:30:50 +0100163
Martin Pitt1d40ddb2015-11-02 10:05:20 -0600164 util-linux >= v2.27.1 required
Mike Gilbertecf4f0a2016-12-20 04:53:53 -0500165 dbus >= 1.4.0 (strictly speaking optional, but recommended)
166 NOTE: If using dbus < 1.9.18, you should override the default
167 policy directory (--with-dbuspolicydir=/etc/dbus-1/system.d).
Zbigniew Jędrzejewski-Szmek2cc86f02012-11-22 15:30:50 +0100168 dracut (optional)
Lennart Poettering46ba8aa2013-02-13 22:56:43 +0100169 PolicyKit (optional)
Zbigniew Jędrzejewski-Szmek2cc86f02012-11-22 15:30:50 +0100170
Zbigniew Jędrzejewski-Szmek3e609a82017-04-18 21:52:30 -0400171 To build in directory build/:
172 meson build/ && ninja -C build
173
174 Any configuration options can be specfied as -Darg=value... arguments
175 to meson. After the build directory is initially configured, meson will
176 refuse to run again, and options must be changed with:
177 mesonconf -Darg=value...
178 mesonconf without any arguments will print out available options and
179 their current values.
180
181 Useful commands:
182 ninja -v some/target
183 ninja test
184 sudo ninja install
185 DESTDIR=... ninja install
186
Zbigniew Jędrzejewski-Szmek72cdb3e2017-07-02 20:21:34 -0400187 A tarball can be created with:
Kay Sievers82627062015-06-23 13:40:53 +0200188 git archive --format=tar --prefix=systemd-222/ v222 | xz > systemd-222.tar.xz
189
Jan Engelhardt19aadac2013-10-22 01:50:48 +0200190 When systemd-hostnamed is used, it is strongly recommended to
191 install nss-myhostname to ensure that, in a world of
192 dynamically changing hostnames, the hostname stays resolvable
Lennart Poetteringfff2e5b2011-05-17 19:35:56 +0200193 under all circumstances. In fact, systemd-hostnamed will warn
Kay Sieversbf9e4772013-01-24 10:31:34 +0100194 if nss-myhostname is not installed.
Lennart Poetteringfff2e5b2011-05-17 19:35:56 +0200195
Zbigniew Jędrzejewski-Szmeka2fc3d82016-10-15 20:51:19 -0400196 Additional packages are necessary to run some tests:
197 - busybox (used by test/TEST-13-NSPAWN-SMOKE)
198 - nc (used by test/TEST-12-ISSUE-3171)
199 - python3-pyparsing
200 - python3-evdev (used by hwdb parsing tests)
201 - strace (used by test/test-functions)
Zbigniew Jędrzejewski-Szmeke94681a2017-02-12 00:22:20 -0500202 - capsh (optional, used by test-execute)
Zbigniew Jędrzejewski-Szmeka2fc3d82016-10-15 20:51:19 -0400203
Lennart Poetteringa24c64f2013-03-05 18:53:21 +0100204USERS AND GROUPS:
Lennart Poettering37495ee2013-03-05 19:15:31 +0100205 Default udev rules use the following standard system group
206 names, which need to be resolvable by getgrnam() at any time,
207 even in the very early boot stages, where no other databases
208 and network are available:
209
Kay Sievers3dff3e02014-06-12 14:59:53 +0200210 audio, cdrom, dialout, disk, input, kmem, lp, tape, tty, video
Kay Sievers37c0e8f2013-03-05 19:04:48 +0100211
Jan Engelhardt19aadac2013-10-22 01:50:48 +0200212 During runtime, the journal daemon requires the
Michael Biebl1a9ce3f2013-03-05 19:19:26 +0100213 "systemd-journal" system group to exist. New journal files will
Jan Engelhardt19aadac2013-10-22 01:50:48 +0200214 be readable by this group (but not writable), which may be used
Zbigniew Jędrzejewski-Szmeka48a62a2015-01-18 15:05:40 -0500215 to grant specific users read access. In addition, system
216 groups "wheel" and "adm" will be given read-only access to
217 journal files using systemd-tmpfiles.service.
Lennart Poetteringa24c64f2013-03-05 18:53:21 +0100218
Lennart Poettering37495ee2013-03-05 19:15:31 +0100219 The journal gateway daemon requires the
Michael Biebl1a9ce3f2013-03-05 19:19:26 +0100220 "systemd-journal-gateway" system user and group to
Lennart Poettering37495ee2013-03-05 19:15:31 +0100221 exist. During execution this network facing service will drop
222 privileges and assume this uid/gid for security reasons.
223
Jan Engelhardt8d0e0dd2014-06-28 00:48:28 +0200224 Similarly, the NTP daemon requires the "systemd-timesync" system
Lennart Poettering323a2f02014-06-04 11:17:32 +0200225 user and group to exist.
Lennart Poetteringa349eb12014-05-17 20:33:47 +0200226
Jan Engelhardt8d0e0dd2014-06-28 00:48:28 +0200227 Similarly, the network management daemon requires the
Lennart Poettering323a2f02014-06-04 11:17:32 +0200228 "systemd-network" system user and group to exist.
Lennart Poetteringe15007b2014-06-01 09:35:19 +0200229
Jan Engelhardt8d0e0dd2014-06-28 00:48:28 +0200230 Similarly, the name resolution daemon requires the
Lennart Poettering323a2f02014-06-04 11:17:32 +0200231 "systemd-resolve" system user and group to exist.
232
Lennart Poettering888e3782016-02-08 23:35:24 +0100233 Similarly, the coredump support requires the
234 "systemd-coredump" system user and group to exist.
235
Lennart Poetteringa4a79602014-08-19 21:55:10 +0200236NSS:
Lennart Poettering409093f2016-07-14 19:19:49 +0200237 systemd ships with four glibc NSS modules:
Lennart Poetteringa4a79602014-08-19 21:55:10 +0200238
239 nss-myhostname resolves the local hostname to locally
240 configured IP addresses, as well as "localhost" to
241 127.0.0.1/::1.
242
243 nss-resolve enables DNS resolution via the systemd-resolved
244 DNS/LLMNR caching stub resolver "systemd-resolved".
245
Lennart Poettering409093f2016-07-14 19:19:49 +0200246 nss-mymachines enables resolution of all local containers registered
247 with machined to their respective IP addresses. It also maps UID/GIDs
248 ranges used by containers to useful names.
Lennart Poetteringa4a79602014-08-19 21:55:10 +0200249
Lennart Poettering409093f2016-07-14 19:19:49 +0200250 nss-systemd enables resolution of all dynamically allocated service
251 users. (See the DynamicUser= setting in unit files.)
Lennart Poetteringa4a79602014-08-19 21:55:10 +0200252
Lennart Poettering409093f2016-07-14 19:19:49 +0200253 To make use of these NSS modules, please add them to the "hosts:",
254 "passwd:" and "group:" lines in /etc/nsswitch.conf. The "resolve"
255 module should replace the glibc "dns" module in this file (and don't
256 worry, it chain-loads the "dns" module if it can't talk to resolved).
Lennart Poetteringa4a79602014-08-19 21:55:10 +0200257
Lennart Poettering409093f2016-07-14 19:19:49 +0200258 The four modules should be used in the following order:
259
260 passwd: compat mymachines systemd
261 group: compat mymachines systemd
Lennart Poetteringa4a79602014-08-19 21:55:10 +0200262 hosts: files mymachines resolve myhostname
263
Martin Pitt0f0467e2015-05-27 17:04:49 +0200264SYSV INIT.D SCRIPTS:
265 When calling "systemctl enable/disable/is-enabled" on a unit which is a
266 SysV init.d script, it calls /usr/lib/systemd/systemd-sysv-install;
267 this needs to translate the action into the distribution specific
268 mechanism such as chkconfig or update-rc.d. Packagers need to provide
269 this script if you need this functionality (you don't if you disabled
270 SysV init support).
271
272 Please see src/systemctl/systemd-sysv-install.SKELETON for how this
273 needs to look like, and provide an implementation at the marked places.
274
Lennart Poettering21bc9232011-02-23 01:12:07 +0100275WARNINGS:
Lennart Poettering21bc9232011-02-23 01:12:07 +0100276 systemd will warn you during boot if /usr is on a different
277 file system than /. While in systemd itself very little will
Jan Engelhardt19aadac2013-10-22 01:50:48 +0200278 break if /usr is on a separate partition, many of its
Lennart Poettering21bc9232011-02-23 01:12:07 +0100279 dependencies very likely will break sooner or later in one
Jan Engelhardt19aadac2013-10-22 01:50:48 +0200280 form or another. For example, udev rules tend to refer to
Lennart Poettering21bc9232011-02-23 01:12:07 +0100281 binaries in /usr, binaries that link to libraries in /usr or
282 binaries that refer to data files in /usr. Since these
Jan Engelhardt19aadac2013-10-22 01:50:48 +0200283 breakages are not always directly visible, systemd will warn
Lennart Poettering21bc9232011-02-23 01:12:07 +0100284 about this, since this kind of file system setup is not really
285 supported anymore by the basic set of Linux OS components.
Lennart Poetteringfc7a7442011-03-01 23:44:26 +0100286
Lennart Poettering47bc23c2014-02-26 02:54:37 +0100287 systemd requires that the /run mount point exists. systemd also
Ronny Chevalier8f42ccd2015-05-30 10:31:41 +0200288 requires that /var/run is a symlink to /run.
Lennart Poettering47bc23c2014-02-26 02:54:37 +0100289
Lennart Poetteringaa167132011-03-04 05:07:01 +0100290 For more information on this issue consult
AsciiWolfc6749ba2017-02-21 18:26:23 +0100291 https://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken
Lennart Poetteringaa167132011-03-04 05:07:01 +0100292
Zbigniew Jędrzejewski-Szmek1b4bb4f2012-10-12 12:56:19 +0000293 To run systemd under valgrind, compile with VALGRIND defined
294 (e.g. ./configure CPPFLAGS='... -DVALGRIND=1'). Otherwise,
295 false positives will be triggered by code which violates
296 some rules but is actually safe.
Lennart Poettering2b671e92014-11-06 15:27:13 +0100297
Lennart Poetteringada64a02015-12-10 11:57:08 +0100298ENGINEERING AND CONSULTING SERVICES:
299 Kinvolk (https://kinvolk.io) offers professional engineering
300 and consulting services for systemd. Please contact Chris Kühl
301 <chris@kinvolk.io> for more information.