1SYSTEMD.PRESET(5) systemd.preset SYSTEMD.PRESET(5)
2
3
4
6 systemd.preset - Service enablement presets
7
9 /etc/systemd/system-preset/*.preset
10
11 /run/systemd/system-preset/*.preset
12
13 /usr/lib/systemd/system-preset/*.preset
14
15 /etc/systemd/user-preset/*.preset
16
17 /run/systemd/user-preset/*.preset
18
19 /usr/lib/systemd/user-preset/*.preset
20
22 Preset files may be used to encode policy which units shall be enabled
23 by default and which ones shall be disabled. They are read by systemctl
24 preset (for more information see systemctl(1)) which uses this
25 information to enable or disable a unit according to preset policy.
26 systemctl preset is used by the post install scriptlets of RPM packages
27 (or other OS package formats), to enable/disable specific units by
28 default on package installation, enforcing distribution, spin or
29 administrator preset policy. This allows choosing a certain set of
30 units to be enabled/disabled even before installing the actual package.
31
32 For more information on the preset logic please have a look at the
33 Presets[1] document.
34
35 It is not recommended to ship preset files within the respective
36 software packages implementing the units, but rather centralize them in
37 a distribution or spin default policy, which can be amended by
38 administrator policy.
39
40 If no preset files exist, systemctl preset will enable all units that
41 are installed by default. If this is not desired and all units shall
42 rather be disabled, it is necessary to ship a preset file with a
43 single, catchall "disable *" line. (See example 1, below.)
44
46 The preset files contain a list of directives consisting of either the
47 word "enable" or "disable" followed by a space and a unit name
48 (possibly with shell style wildcards), separated by newlines. Empty
49 lines and lines whose first non-whitespace character is # or ; are
50 ignored.
51
52 Two different directives are understood: "enable" may be used to enable
53 units by default, "disable" to disable units by default.
54
55 If multiple lines apply to a unit name, the first matching one takes
56 precedence over all others.
57
58 Each preset file shall be named in the style of
59 <priority>-<program>.conf. Files in /etc/ override files with the same
60 name in /usr/lib/ and /run/. Files in /run/ override files with the
61 same name in /usr/lib/. Packages should install their preset files in
62 /usr/lib/. Files in /etc/ are reserved for the local administrator, who
63 may use this logic to override the preset files installed by vendor
64 packages. All preset files are sorted by their filename in
65 lexicographic order, regardless of which of the directories they reside
66 in. If multiple files specify the same unit name, the entry in the file
67 with the lexicographically earliest name will be applied. It is
68 recommended to prefix all filenames with a two-digit number and a dash,
69 to simplify the ordering of the files.
70
71 If the administrator wants to disable a preset file supplied by the
72 vendor, the recommended way is to place a symlink to /dev/null in
73 /etc/systemd/system-preset/ bearing the same filename.
74
76 Example 1. Default off example
77 /usr/lib/systemd/system-preset/99-default.preset:
78
79 disable *
80
81 This disables all units. Due to the filename prefix "99-", it will be
82 read last and hence can easily be overridden by spin or administrator
83 preset policy or suchlike.
84
85 Example 2. A GNOME spin example
86 /usr/lib/systemd/system-preset/50-gnome.preset:
87
88 enable gdm.service
89 enable colord.service
90 enable accounts-daemon.service
91 enable avahi-daemon.*
92
93 This enables the three mentioned units, plus all avahi-daemon
94 regardless of which unit type. A file like this could be useful for
95 inclusion in a GNOME spin of a distribution. It will ensure that the
96 units necessary for GNOME are properly enabled as they are installed.
97 It leaves all other units untouched, and subject to other (later)
98 preset files, for example like the one from the first example above.
99
100 Example 3. Administrator policy
101 /etc/systemd/system-preset/00-lennart.preset:
102
103 enable httpd.service
104 enable sshd.service
105 enable postfix.service
106 disable *
107
108 This enables three specific services and disables all others. This is
109 useful for administrators to specifically select the units to enable,
110 and disable all others. Due to the filename prefix "00-" it will be
111 read early and hence overrides all other preset policy files.
112
114 systemd(1), systemctl(1), systemd-delta(1)
115
117 1. Presets
118 http://freedesktop.org/wiki/Software/systemd/Preset
119
120
121
122systemd 219 SYSTEMD.PRESET(5)