]> git.ipfire.org Git - thirdparty/systemd.git/blob - README
tree-wide: add FORMAT_BYTES()
[thirdparty/systemd.git] / README
1 systemd System and Service Manager
2
3 DETAILS:
4 http://0pointer.de/blog/projects/systemd.html
5
6 WEB SITE:
7 https://www.freedesktop.org/wiki/Software/systemd
8
9 GIT:
10 git@github.com:systemd/systemd.git
11 https://github.com/systemd/systemd
12
13 MAILING LIST:
14 https://lists.freedesktop.org/mailman/listinfo/systemd-devel
15
16 IRC:
17 #systemd on irc.libera.chat
18
19 BUG REPORTS:
20 https://github.com/systemd/systemd/issues
21
22 AUTHOR:
23 Lennart Poettering
24 Kay Sievers
25 ...and many others
26
27 LICENSE:
28 LGPLv2.1+ for all code
29 - except src/basic/MurmurHash2.c which is Public Domain
30 - except src/basic/siphash24.c which is CC0 Public Domain
31 - except src/journal/lookup3.c which is Public Domain
32 - except src/udev/* which is (currently still) GPLv2, GPLv2+
33 - except tools/chromiumos/* which is BSD-style
34
35 REQUIREMENTS:
36 Linux kernel >= 3.13
37 Linux kernel >= 4.2 for unified cgroup hierarchy support
38 Linux kernel >= 4.10 for cgroup-bpf egress and ingress hooks
39 Linux kernel >= 4.15 for cgroup-bpf device hook
40 Linux kernel >= 4.17 for cgroup-bpf socket address hooks
41 Linux kernel >= 5.3 for bounded-loops in BPF program
42 Linux kernel >= 5.4 for signed Verity images support
43
44 Kernel Config Options:
45 CONFIG_DEVTMPFS
46 CONFIG_CGROUPS (it is OK to disable all controllers)
47 CONFIG_INOTIFY_USER
48 CONFIG_SIGNALFD
49 CONFIG_TIMERFD
50 CONFIG_EPOLL
51 CONFIG_UNIX (it requires CONFIG_NET, but every other flag in it is not necessary)
52 CONFIG_SYSFS
53 CONFIG_PROC_FS
54 CONFIG_FHANDLE (libudev, mount and bind mount handling)
55
56 Kernel crypto/hash API
57 CONFIG_CRYPTO_USER_API_HASH
58 CONFIG_CRYPTO_HMAC
59 CONFIG_CRYPTO_SHA256
60
61 udev will fail to work with the legacy sysfs layout:
62 CONFIG_SYSFS_DEPRECATED=n
63
64 Legacy hotplug slows down the system and confuses udev:
65 CONFIG_UEVENT_HELPER_PATH=""
66
67 Userspace firmware loading is not supported and should
68 be disabled in the kernel:
69 CONFIG_FW_LOADER_USER_HELPER=n
70
71 Some udev rules and virtualization detection relies on it:
72 CONFIG_DMIID
73
74 Support for some SCSI devices serial number retrieval, to
75 create additional symlinks in /dev/disk/ and /dev/tape:
76 CONFIG_BLK_DEV_BSG
77
78 Required for PrivateNetwork= in service units:
79 CONFIG_NET_NS
80 Note that systemd-localed.service and other systemd units use
81 PrivateNetwork so this is effectively required.
82
83 Required for PrivateUsers= in service units:
84 CONFIG_USER_NS
85
86 Optional but strongly recommended:
87 CONFIG_IPV6
88 CONFIG_AUTOFS_FS
89 CONFIG_TMPFS_XATTR
90 CONFIG_{TMPFS,EXT4_FS,XFS,BTRFS_FS,...}_POSIX_ACL
91 CONFIG_SECCOMP
92 CONFIG_SECCOMP_FILTER (required for seccomp support)
93 CONFIG_CHECKPOINT_RESTORE (for the kcmp() syscall)
94
95 Required for CPUShares= in resource control unit settings
96 CONFIG_CGROUP_SCHED
97 CONFIG_FAIR_GROUP_SCHED
98
99 Required for CPUQuota= in resource control unit settings
100 CONFIG_CFS_BANDWIDTH
101
102 Required for IPAddressDeny=, IPAddressAllow=, IPIngressFilterPath=,
103 IPEgressFilterPath= in resource control unit settings
104 unit settings
105 CONFIG_BPF
106 CONFIG_BPF_SYSCALL
107 CONFIG_BPF_JIT
108 CONFIG_HAVE_EBPF_JIT
109 CONFIG_CGROUP_BPF
110
111 Required for SocketBind{Allow|Deny}= in resource control unit settings
112 CONFIG_BPF
113 CONFIG_BPF_SYSCALL
114 CONFIG_BPF_JIT
115 CONFIG_HAVE_EBPF_JIT
116 CONFIG_CGROUP_BPF
117
118 For UEFI systems:
119 CONFIG_EFIVAR_FS
120 CONFIG_EFI_PARTITION
121
122 Required for signed Verity images support:
123 CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG
124
125 We recommend to turn off Real-Time group scheduling in the
126 kernel when using systemd. RT group scheduling effectively
127 makes RT scheduling unavailable for most userspace, since it
128 requires explicit assignment of RT budgets to each unit whose
129 processes making use of RT. As there's no sensible way to
130 assign these budgets automatically this cannot really be
131 fixed, and it's best to disable group scheduling hence.
132 CONFIG_RT_GROUP_SCHED=n
133
134 It's a good idea to disable the implicit creation of networking bonding
135 devices by the kernel networking bonding module, so that the
136 automatically created "bond0" interface doesn't conflict with any such
137 device created by systemd-networkd (or other tools). Ideally there
138 would be a kernel compile-time option for this, but there currently
139 isn't. The next best thing is to make this change through a modprobe.d
140 drop-in. This is shipped by default, see modprobe.d/systemd.conf.
141
142 Required for systemd-nspawn:
143 CONFIG_DEVPTS_MULTIPLE_INSTANCES or Linux kernel >= 4.7
144
145 Required for systemd-oomd:
146 CONFIG_PSI
147
148 Note that kernel auditing is broken when used with systemd's
149 container code. When using systemd in conjunction with
150 containers, please make sure to either turn off auditing at
151 runtime using the kernel command line option "audit=0", or
152 turn it off at kernel compile time using:
153 CONFIG_AUDIT=n
154 If systemd is compiled with libseccomp support on
155 architectures which do not use socketcall() and where seccomp
156 is supported (this effectively means x86-64 and ARM, but
157 excludes 32-bit x86!), then nspawn will now install a
158 work-around seccomp filter that makes containers boot even
159 with audit being enabled. This works correctly only on kernels
160 3.14 and newer though. TL;DR: turn audit off, still.
161
162 glibc >= 2.16
163 libcap
164 libmount >= 2.30 (from util-linux)
165 (util-linux *must* be built without --enable-libmount-support-mtab)
166 libseccomp >= 2.3.1 (optional)
167 libblkid >= 2.24 (from util-linux) (optional)
168 libkmod >= 15 (optional)
169 PAM >= 1.1.2 (optional)
170 libcryptsetup (optional), >= 2.3.0 required for signed Verity images support
171 libaudit (optional)
172 libacl (optional)
173 libbpf >= 0.2.0 (optional)
174 libfdisk >= 2.33 (from util-linux) (optional)
175 libselinux (optional)
176 liblzma (optional)
177 liblz4 >= 1.3.0 / 130 (optional)
178 libzstd >= 1.4.0 (optional)
179 libgcrypt (optional)
180 libqrencode (optional)
181 libmicrohttpd (optional)
182 libpython (optional)
183 libidn2 or libidn (optional)
184 gnutls >= 3.1.4 (optional, >= 3.6.0 is required to support DNS-over-TLS with gnutls)
185 openssl >= 1.1.0 (optional, required to support DNS-over-TLS with openssl)
186 elfutils >= 158 (optional)
187 polkit (optional)
188 tzdata >= 2014f (optional)
189 pkg-config
190 gperf
191 docbook-xsl (optional, required for documentation)
192 xsltproc (optional, required for documentation)
193 python-jinja2
194 python-lxml (optional, required to build the indices)
195 python >= 3.5
196 meson >= 0.46 (>= 0.49 is required to build position-independent executables)
197 ninja
198 gcc, awk, sed, grep, and similar tools
199 clang >= 10.0, llvm >= 10.0 (optional, required to build BPF programs
200 from source code in C)
201
202 During runtime, you need the following additional
203 dependencies:
204
205 util-linux >= v2.27.1 required
206 dbus >= 1.4.0 (strictly speaking optional, but recommended)
207 NOTE: If using dbus < 1.9.18, you should override the default
208 policy directory (--with-dbuspolicydir=/etc/dbus-1/system.d).
209 dracut (optional)
210 polkit (optional)
211
212 To build in directory build/:
213 meson setup build/ && meson compile -C build/
214
215 Any configuration options can be specified as -Darg=value... arguments
216 to meson. After the build directory is initially configured, meson will
217 refuse to run again, and options must be changed with:
218 meson configure -Darg=value build/
219 meson configure without any arguments will print out available options and
220 their current values.
221
222 Useful commands:
223 meson compile -v -C build/ some/target
224 meson test -C build/
225 sudo meson install -C build/
226 DESTDIR=... meson install -C build/
227
228 A tarball can be created with:
229 git archive --format=tar --prefix=systemd-222/ v222 | xz > systemd-222.tar.xz
230
231 When systemd-hostnamed is used, it is strongly recommended to
232 install nss-myhostname to ensure that, in a world of
233 dynamically changing hostnames, the hostname stays resolvable
234 under all circumstances. In fact, systemd-hostnamed will warn
235 if nss-myhostname is not installed.
236
237 nss-systemd must be enabled on systemd systems, as that's required for
238 DynamicUser= to work. Note that we ship services out-of-the-box that
239 make use of DynamicUser= now, hence enabling nss-systemd is not
240 optional.
241
242 Note that the build prefix for systemd must be /usr. (Moreover,
243 packages systemd relies on — such as D-Bus — really should use the same
244 prefix, otherwise you are on your own.) -Dsplit-usr=false (which is the
245 default and does not need to be specified) is the recommended setting.
246 -Dsplit-usr=true can be used to give a semblance of support for systems
247 with programs installed split between / and /usr. Moving everything
248 under /usr is strongly encouraged.
249
250 Additional packages are necessary to run some tests:
251 - busybox (used by test/TEST-13-NSPAWN-SMOKE)
252 - nc (used by test/TEST-12-ISSUE-3171)
253 - python3-pyparsing
254 - python3-evdev (used by hwdb parsing tests)
255 - strace (used by test/test-functions)
256 - capsh (optional, used by test-execute)
257
258 USERS AND GROUPS:
259 Default udev rules use the following standard system group
260 names, which need to be resolvable by getgrnam() at any time,
261 even in the very early boot stages, where no other databases
262 and network are available:
263
264 audio, cdrom, dialout, disk, input, kmem, kvm, lp, render, tape, tty, video
265
266 During runtime, the journal daemon requires the
267 "systemd-journal" system group to exist. New journal files will
268 be readable by this group (but not writable), which may be used
269 to grant specific users read access. In addition, system
270 groups "wheel" and "adm" will be given read-only access to
271 journal files using systemd-tmpfiles.service.
272
273 The journal remote daemon requires the
274 "systemd-journal-remote" system user and group to
275 exist. During execution this network facing service will drop
276 privileges and assume this uid/gid for security reasons.
277
278 Similarly, the network management daemon requires the
279 "systemd-network" system user and group to exist.
280
281 Similarly, the name resolution daemon requires the
282 "systemd-resolve" system user and group to exist.
283
284 Similarly, the coredump support requires the
285 "systemd-coredump" system user and group to exist.
286
287 NSS:
288 systemd ships with four glibc NSS modules:
289
290 nss-myhostname resolves the local hostname to locally configured IP
291 addresses, as well as "localhost" to 127.0.0.1/::1.
292
293 nss-resolve enables DNS resolution via the systemd-resolved DNS/LLMNR
294 caching stub resolver "systemd-resolved".
295
296 nss-mymachines enables resolution of all local containers registered
297 with machined to their respective IP addresses.
298
299 nss-systemd enables resolution of users/group registered via the
300 User/Group Record Lookup API (https://systemd.io/USER_GROUP_API),
301 including all dynamically allocated service users. (See the
302 DynamicUser= setting in unit files.)
303
304 To make use of these NSS modules, please add them to the "hosts:",
305 "passwd:" and "group:" lines in /etc/nsswitch.conf. The "resolve"
306 module should replace the glibc "dns" module in this file (and don't
307 worry, it chain-loads the "dns" module if it can't talk to resolved).
308
309 The four modules should be used in the following order:
310
311 passwd: compat systemd
312 group: compat systemd
313 hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname
314
315 SYSV INIT.D SCRIPTS:
316 When calling "systemctl enable/disable/is-enabled" on a unit which is a
317 SysV init.d script, it calls /usr/lib/systemd/systemd-sysv-install;
318 this needs to translate the action into the distribution specific
319 mechanism such as chkconfig or update-rc.d. Packagers need to provide
320 this script if you need this functionality (you don't if you disabled
321 SysV init support).
322
323 Please see src/systemctl/systemd-sysv-install.SKELETON for how this
324 needs to look like, and provide an implementation at the marked places.
325
326 WARNINGS:
327 systemd will warn during early boot if /usr is not already mounted at
328 this point (that means: either located on the same file system as / or
329 already mounted in the initrd). While in systemd itself very little
330 will break if /usr is on a separate, late-mounted partition, many of
331 its dependencies very likely will break sooner or later in one form or
332 another. For example, udev rules tend to refer to binaries in /usr,
333 binaries that link to libraries in /usr or binaries that refer to data
334 files in /usr. Since these breakages are not always directly visible,
335 systemd will warn about this, since this kind of file system setup is
336 not really supported anymore by the basic set of Linux OS components.
337
338 systemd requires that the /run mount point exists. systemd also
339 requires that /var/run is a symlink to /run.
340
341 For more information on this issue consult
342 https://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken
343
344 To run systemd under valgrind, compile with meson option
345 -Dvalgrind=true and have valgrind development headers installed
346 (i.e. valgrind-devel or equivalent). Otherwise, false positives will be
347 triggered by code which violates some rules but is actually safe. Note
348 that valgrind generates nice output only on exit(), hence on shutdown
349 we don't execve() systemd-shutdown.
350
351 STABLE BRANCHES AND BACKPORTS:
352 Stable branches with backported patches are available in the
353 systemd-stable repo at https://github.com/systemd/systemd-stable.
354
355 Stable branches are started for certain releases of systemd and named
356 after them, e.g. v238-stable. Stable branches are managed by
357 distribution maintainers on an as needed basis. See
358 https://www.freedesktop.org/wiki/Software/systemd/Backports/ for some
359 more information and examples.