From 75d67e683735035949bfdcf71140747b9909d8a1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 27 Jun 2012 16:29:08 +0200 Subject: man: document preset files --- man/systemctl.xml | 14 ++-- man/systemd.preset.xml | 199 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+), 5 deletions(-) create mode 100644 man/systemd.preset.xml (limited to 'man') diff --git a/man/systemctl.xml b/man/systemctl.xml index 64f2edf64a..646437a4ca 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -814,12 +814,15 @@ Reset one or more unit files, as specified on the command - line, to the defaults configured in a - preset file. This has the same effect - as disable or + line, to the defaults configured in + the preset policy files. This has the + same effect as + disable or enable, depending how the unit is listed in the preset - files. + files. For more information on preset + policy see + systemd.preset5. @@ -1230,7 +1233,8 @@ loginctl1, systemd.unit5, systemd.special7, - wall1 + wall1, + systemd.preset5 diff --git a/man/systemd.preset.xml b/man/systemd.preset.xml new file mode 100644 index 0000000000..21de529366 --- /dev/null +++ b/man/systemd.preset.xml @@ -0,0 +1,199 @@ + + + + + + + + systemd.preset + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.preset + 5 + + + + systemd.preset + Service enablement presets + + + + /etc/systemd/system-preset/*.preset + /run/systemd/system-preset/*.preset + /usr/lib/systemd/system-preset/*.preset + /etc/systemd/user-preset/*.preset + /run/systemd/user-preset/*.preset + /usr/lib/systemd/user-preset/*.preset + + + + Description + + Preset files may be used to encode policy which + services shall be enabled by default and which ones + shall be disabled. They are read by systemctl + preset (for more information see + systemctl1) + which uses this information to enable or disable a + unit according to preset policy. systemctl + preset 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. + + It is not recommended to ship preset files + within the respective software packages implementing + the services, but rather centralize them in a + distribution or spin default policy, which can be + amended by administrator policy. + + If no preset files exist, systemctl + preset will enable all units that are + installed by default. If this is not desired and all + units shall rather be disabled it is necessary to ship + a preset file with a single, catchall + "disable *" line. (See example 1, + below.) + + + + Preset File Format + + The preset files contain a list of + directives consisting of either the word + enable or + disable followed by a space and a + unit name (possibly with shell style wildcards), + separated by newlines. Empty lines and lines whose + first non-whitespace character is # or ; are + ignored. + + Two different directives are understood: + enable may be used to enable units + by default, disable to disable + units by default. + + If multiple lines apply to a unit name the + first matching one takes precedence over all + others. + + Each preset file shall be named in the style of + <priority>-<program>.conf. + Files in /etc/ override files + with the same name in /usr/lib/ + and /run/. Files in + /run/ override files with the + same name in /usr/lib/. Packages + should install their preset files in + /usr/lib/. Files in + /etc/ are reserved for the local + administrator, who may use this logic to override the + preset files installed by vendor packages. All preset + files are sorted by their filename in alphabetical + order, regardless in which of the directories they + reside, to guarantee that a specific preset file takes + precedence over another file with an alphabetically + earlier name, if both files contain lines that apply + to the same unit names. It is recommended to prefix + all file names with two-digit number, to simplify + ordering. + + If the administrator wants to disable a preset + file supplied by the vendor the recommended way is to + place a symlink to /dev/null in + /etc/systemd/system-preset/ + bearing the same file name. + + + + Example + + + Default off example <filename>/usr/lib/systemd/system-preset/99-default.preset</filename>: + + disable * + + + This disables all units. Due to the file name + prefix 99- it will be read last and + hence can easily be overridden by spin or + administrator preset policy or suchlike. + + + A GNOME spin example <filename>/usr/lib/systemd/system-preset/50-gnome.preset</filename>: + + enable gdm.service +enable colord.service +enable accounts-daemon.service +enable avahi-daemon.* + + + + This enables the three mentioned units, plus all + avahi-daemon regardless of which + unit type. A file like this could be useful for + inclusion in a GNOME spin of a distribution. It will + ensure that the units necessary for GNOME are properly + enabled as they are installed. It leaves all other + units untouched, and subject to other (later) preset + files, for example like the one from the first example + above. + + + Administrator policy <filename>/etc/systemd/system-preset/00-lennart.preset</filename>: + + enable httpd.service +enable sshd.service +enable postfix.service +disable * + + + This enables three specific services and + disables all others. This is useful for administrators + to specifically select the units to enable, and + disable all others. Due to the file name prefix + 00- it will be read early and hence + overrides all other preset policy files. + + + + See Also + + systemd1, + systemctl1, + systemd-delta1 + + + + -- cgit v1.2.3-54-g00ecf