]> git.ipfire.org Git - thirdparty/systemd.git/blame - docs/DISTRO_PORTING.md
fileio: add brief explanations for flags
[thirdparty/systemd.git] / docs / DISTRO_PORTING.md
CommitLineData
c3e270f4
FB
1---
2title: Porting systemd To New Distributions
4cdca0af 3category: Concepts
b41a3f66 4layout: default
c3e270f4
FB
5---
6
1d1cb168
FB
7# Porting systemd To New Distributions
8
9## HOWTO
10
11You need to make the follow changes to adapt systemd to your
12distribution:
13
141. Find the right configure parameters for:
15
16 * `-Drootprefix=`
17 * `-Dsysvinit-path=`
18 * `-Dsysvrcnd-path=`
19 * `-Drc-local=`
1d1cb168
FB
20 * `-Dloadkeys-path=`
21 * `-Dsetfont-path=`
22 * `-Dtty-gid=`
23 * `-Dntp-servers=`
24 * `-Ddns-servers=`
25 * `-Dsupport-url=`
26
272. Try it out.
28
29 Play around (as an ordinary user) with
30 `/usr/lib/systemd/systemd --test --system` for a test run
31 of systemd without booting. This will read the unit files and
32 print the initial transaction it would execute during boot-up.
33 This will also inform you about ordering loops and suchlike.
34
57903f93
ZJS
35## Compilation options
36
37The default configuration does not enable any optimization or hardening
38options. This is suitable for development and testing, but not for end-user
39installations.
40
41For deployment, optimization (`-O2` or `-O3` compiler options), link time
42optimization (`-Db_lto=true` meson option), and hardening (e.g.
43`-D_FORTIFY_SOURCE=2`, `-fstack-protector-strong`, `-fstack-clash-protection`,
44`-fcf-protection`, `-pie` compiler options, and `-z relro`, `-z now`,
45`--as-needed` linker options) are recommended. The most appropriate set of
46options depends on the architecture and distribution specifics so no default is
47provided.
48
1d1cb168
FB
49## NTP Pool
50
51By default, systemd-timesyncd uses the Google Public NTP servers
52`time[1-4].google.com`, if no other NTP configuration is available.
53They serve time that uses a
54[leap second smear](https://developers.google.com/time/smear)
55and can be up to .5s off from servers that use stepped leap seconds.
56
57If you prefer to use leap second steps, please register your own
58vendor pool at ntp.org and make it the built-in default by
59passing `-Dntp-servers=` to meson. Registering vendor
60pools is [free](http://www.pool.ntp.org/en/vendors.html).
61
62Use `-Dntp-servers=` to direct systemd-timesyncd to different fallback
63NTP servers.
64
65## DNS Servers
66
def3c7c7
IK
67By default, systemd-resolved uses Cloudflare and Google Public DNS servers
68`1.1.1.1`, `8.8.8.8`, `1.0.0.1`, `8.8.4.4`, `2606:4700:4700::1111`, `2001:4860:4860::8888`, `2606:4700:4700::1001`, `2001:4860:4860::8844`
1d1cb168
FB
69as fallback, if no other DNS configuration is available.
70
71Use `-Ddns-servers=` to direct systemd-resolved to different fallback
72DNS servers.
73
74## PAM
75
76The default PAM config shipped by systemd is really bare bones.
77It does not include many modules your distro might want to enable
78to provide a more seamless experience. For example, limits set in
79`/etc/security/limits.conf` will not be read unless you load `pam_limits`.
80Make sure you add modules your distro expects from user services.
81
82Pass `-Dpamconfdir=no` to meson to avoid installing this file and
83instead install your own.
84
85## Contributing Upstream
86
87We generally do no longer accept distribution-specific patches to
88systemd upstream. If you have to make changes to systemd's source code
89to make it work on your distribution, unless your code is generic
90enough to be generally useful, we are unlikely to merge it. Please
91always consider adopting the upstream defaults. If that is not
92possible, please maintain the relevant patches downstream.
93
94Thank you for understanding.