diff options
author | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-02-02 23:15:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-02 23:15:19 +0000 |
commit | 23cfef7bb106784c1b25e154ff88b67b039927be (patch) | |
tree | c0774779dffe42474fe142e7c885fea3dbddf3ef | |
parent | edf370af9e9fafad01393699e7a6f34bf0568dd6 (diff) | |
parent | 0411a11811430bd5e5e3b1b4d52cc8ddbe54132b (diff) | |
download | systemd-23cfef7bb106784c1b25e154ff88b67b039927be.tar.gz |
Merge pull request #18435 from keszybz/oomd-readiness-and-other-tweaks
Mark oomd as supported and other tweaks
-rw-r--r-- | docs/PORTABILITY_AND_STABILITY.md | 2 | ||||
-rw-r--r-- | man/systemctl.xml | 4 | ||||
-rw-r--r-- | man/systemd.preset.xml | 75 | ||||
-rw-r--r-- | meson.build | 12 | ||||
-rw-r--r-- | meson_options.txt | 2 | ||||
-rw-r--r-- | src/kernel-install/meson.build | 3 |
6 files changed, 59 insertions, 39 deletions
diff --git a/docs/PORTABILITY_AND_STABILITY.md b/docs/PORTABILITY_AND_STABILITY.md index 0caa5cc048..27562c17d8 100644 --- a/docs/PORTABILITY_AND_STABILITY.md +++ b/docs/PORTABILITY_AND_STABILITY.md @@ -120,7 +120,7 @@ And now, here's the list of (hopefully) all APIs that we have introduced with sy | `/run` | File hierarchy change | yes | yes | numerous | yes | OpenSUSE, Debian, ArchLinux | no | | [Generators](https://www.freedesktop.org/software/systemd/man/systemd.generator.html) | Subprocess | yes | yes | - | no | - | no | | [System Updates](https://www.freedesktop.org/software/systemd/man/systemd.offline-updates.html) | System Mode | yes | yes | - | no | - | no | -| [Presets](https://freedesktop.org/wiki/Software/systemd/Preset) | File format | yes | yes | - | no | - | no | +| [Presets](https://www.freedesktop.org/software/systemd/man/systemd.preset.html) | File format | yes | yes | - | no | - | no | | Udev rules | File format | yes | yes | numerous | no | no | partially | diff --git a/man/systemctl.xml b/man/systemctl.xml index e49a12a146..db4e2b2c65 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -793,9 +793,7 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err <para>For more information on the preset policy format, see <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>. - For more information on the concept of presets, please consult the - <ulink url="https://www.freedesktop.org/wiki/Software/systemd/Preset">Preset</ulink> - document.</para> + </para> </listitem> </varlistentry> diff --git a/man/systemd.preset.xml b/man/systemd.preset.xml index 5697e50be7..cbd89daf16 100644 --- a/man/systemd.preset.xml +++ b/man/systemd.preset.xml @@ -32,28 +32,20 @@ <refsect1> <title>Description</title> - <para>Preset files may be used to encode policy which units shall - be enabled by default and which ones shall be disabled. They are - read by <command>systemctl preset</command> (for more information - see - <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>) - which uses this information to enable or disable a unit according - to preset policy. <command>systemctl preset</command> is used by - the post install scriptlets of RPM packages (or other OS package - formats), to enable/disable specific units by default on package - installation, enforcing distribution, spin or administrator preset - policy. This allows choosing a certain set of units to be - enabled/disabled even before installing the actual package.</para> - - <para>For more information on the preset logic please have a look - at the <ulink - url="https://www.freedesktop.org/wiki/Software/systemd/Preset">Presets</ulink> - document.</para> - - <para>It is not recommended to ship preset files within the - respective software packages implementing the units, but rather - centralize them in a distribution or spin default policy, which - can be amended by administrator policy.</para> + <para>Preset files may be used to encode policy which units shall be enabled by default and which ones + shall be disabled. They are read by <command>systemctl preset</command> which uses this information to + enable or disable a unit. Depending on that policy, <command>systemctl preset</command> is identical to + <command>systemctl enable</command> or <command>systemctl disable</command>. + + <command>systemctl preset</command> is used by the post install scriptlets of rpm packages (or other OS + package formats), to enable/disable specific units by default on package installation, enforcing + distribution, spin or administrator preset policy. This allows choosing a certain set of units to be + enabled/disabled even before installing the actual package. For more information, see + <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para> + + <para>It is not recommended to ship preset files within the respective software packages implementing the + units, but rather centralize them in a distribution or spin default policy, which can be amended by + administrator policy, see below.</para> <para>If no preset files exist, <command>systemctl preset</command> will enable all units that are installed by @@ -176,12 +168,51 @@ disable *</programlisting> </refsect1> <refsect1> + <title>Motiviation for the preset logic</title> + + <para>Different distributions have different policies on which services shall be enabled by default when + the package they are shipped in is installed. On Fedora all services stay off by default, so that + installing a package will not cause a service to be enabled (with some exceptions). On Debian all + services are immediately enabled by default, so that installing a package will cause its services to be + enabled right-away.</para> + + <para>Even within a single distribution, different spins (flavours, remixes, whatever you might want to + call them) of a distribution also have different policies on what services to enable, and what services + to leave off. For example, Fedora Workstation will enable <command>gdm</command> as display manager by + default, while the Fedora KDE spin will enable <command>sddm</command> instead.</para> + + <para>Different sites might also have different policies what to turn on by default and what to turn + off. For example, one administrator would prefer to enforce the policy of "<command>sshd</command> should + be always on, but everything else off", while another one might say "<command>snmpd</command> always on, + and for everything else use the distribution policy defaults".</para> + + <para>Traditionally, policy about which services shall be enabled were implemented in each package + individually. This made it cumbersome to implement different policies per spin or per site, or to create + software packages that do the right thing on more than one distribution. The enablement mechanism was + also encoding the enablement policy.</para> + + <para>The preset mechanism allows clean separation of the enablement mechanism (inside the package + scriptlets, by invoking <command>systemctl preset</command>) and enablement policy (centralized in the + preset files), and lifts the configuration out of individual packages. Preset files may be written for + specific distributions, for specific spins or for specific sites, in order to enforce different policies + as needed. It is recommended to apply the policy encoded in preset files in package installation + scriptlets.</para> + </refsect1> + + <refsect1> <title>See Also</title> <para> <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, <citerefentry><refentrytitle>systemd-delta</refentrytitle><manvolnum>1</manvolnum></citerefentry> </para> + + <para><citerefentry><refentrytitle>daemon</refentrytitle><manvolnum>8</manvolnum></citerefentry> + has a discussion of packaging scriptlets.</para> + + <para>Fedora page introducing the use of presets: + <ulink url="https://fedoraproject.org/wiki/Features/PackagePresets">Features/PackagePresets</ulink>. + </para> </refsect1> </refentry> diff --git a/meson.build b/meson.build index 0af0cce8b8..01eeeb750e 100644 --- a/meson.build +++ b/meson.build @@ -1450,14 +1450,6 @@ have = have and conf.get('HAVE_PAM') == 1 conf.set10('ENABLE_PAM_HOME', have) have = get_option('oomd') -if have == 'auto' - have = get_option('mode') == 'developer' -else - have = have == 'true' - if have and get_option('mode') != 'developer' - warning('oomd is not ready for release mode (yet)') - endif -endif conf.set10('ENABLE_OOMD', have) substs.set10('ENABLE_OOMD', have) @@ -3668,8 +3660,8 @@ status = [ conf.get('SYSTEM_ALLOC_UID_MIN')), 'system GIDs: <=@0@ (alloc >=@1@)'.format(conf.get('SYSTEM_GID_MAX'), conf.get('SYSTEM_ALLOC_GID_MIN')), - 'dynamic UIDs: @0@–@1@'.format(dynamic_uid_min, dynamic_uid_max), - 'container UID bases: @0@–@1@'.format(container_uid_base_min, container_uid_base_max), + 'dynamic UIDs: @0@…@1@'.format(dynamic_uid_min, dynamic_uid_max), + 'container UID bases: @0@…@1@'.format(container_uid_base_min, container_uid_base_max), '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')), 'render group access mode: @0@'.format(get_option('group-render-mode')), 'certificate root directory: @0@'.format(get_option('certificate-root')), diff --git a/meson_options.txt b/meson_options.txt index a421473029..425e958ba2 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -99,7 +99,7 @@ option('coredump', type : 'boolean', description : 'install the coredump handler') option('pstore', type : 'boolean', description : 'install the pstore archival tool') -option('oomd', type : 'combo', choices : ['auto', 'true', 'false'], +option('oomd', type : 'boolean', description : 'install the userspace oom killer') option('logind', type : 'boolean', description : 'install the systemd-logind stack') diff --git a/src/kernel-install/meson.build b/src/kernel-install/meson.build index 4117188f14..92ce23ecf9 100644 --- a/src/kernel-install/meson.build +++ b/src/kernel-install/meson.build @@ -4,8 +4,7 @@ want_kernel_install = get_option('kernel-install') if want_kernel_install install_data('kernel-install', - install_mode : 'rwxr-xr-x', - install_dir : bindir) + install_mode : 'rwxr-xr-x') install_data('00-entry-directory.install', '50-depmod.install', |