]>
Commit | Line | Data |
---|---|---|
14228c0d | 1 | '\" t |
5eef597e | 2 | .TH "SYSTEMD\&.PRESET" "5" "" "systemd 217" "systemd.preset" |
14228c0d MB |
3 | .\" ----------------------------------------------------------------- |
4 | .\" * Define some portability stuff | |
5 | .\" ----------------------------------------------------------------- | |
6 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
7 | .\" http://bugs.debian.org/507673 | |
8 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html | |
9 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
10 | .ie \n(.g .ds Aq \(aq | |
11 | .el .ds Aq ' | |
12 | .\" ----------------------------------------------------------------- | |
13 | .\" * set default formatting | |
14 | .\" ----------------------------------------------------------------- | |
15 | .\" disable hyphenation | |
16 | .nh | |
17 | .\" disable justification (adjust text to left margin only) | |
18 | .ad l | |
19 | .\" ----------------------------------------------------------------- | |
20 | .\" * MAIN CONTENT STARTS HERE * | |
21 | .\" ----------------------------------------------------------------- | |
22 | .SH "NAME" | |
23 | systemd.preset \- Service enablement presets | |
24 | .SH "SYNOPSIS" | |
25 | .PP | |
26 | /etc/systemd/system\-preset/*\&.preset | |
27 | .PP | |
28 | /run/systemd/system\-preset/*\&.preset | |
29 | .PP | |
30 | /usr/lib/systemd/system\-preset/*\&.preset | |
31 | .PP | |
32 | /etc/systemd/user\-preset/*\&.preset | |
33 | .PP | |
34 | /run/systemd/user\-preset/*\&.preset | |
35 | .PP | |
36 | /usr/lib/systemd/user\-preset/*\&.preset | |
37 | .SH "DESCRIPTION" | |
38 | .PP | |
39 | 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 | |
40 | \fBsystemctl preset\fR | |
41 | (for more information see | |
42 | \fBsystemctl\fR(1)) which uses this information to enable or disable a unit according to preset policy\&. | |
43 | \fBsystemctl preset\fR | |
44 | 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\&. | |
45 | .PP | |
46 | For more information on the preset logic please have a look at the | |
47 | \m[blue]\fBPresets\fR\m[]\&\s-2\u[1]\d\s+2 | |
48 | document\&. | |
49 | .PP | |
50 | 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\&. | |
51 | .PP | |
52 | If no preset files exist, | |
53 | \fBsystemctl preset\fR | |
54 | 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\&.) | |
55 | .SH "PRESET FILE FORMAT" | |
56 | .PP | |
57 | The preset files contain a list of directives consisting of either the word | |
58 | "enable" | |
59 | or | |
60 | "disable" | |
61 | 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\&. | |
62 | .PP | |
63 | Two different directives are understood: | |
64 | "enable" | |
65 | may be used to enable units by default, | |
66 | "disable" | |
67 | to disable units by default\&. | |
68 | .PP | |
69 | If multiple lines apply to a unit name, the first matching one takes precedence over all others\&. | |
70 | .PP | |
71 | Each preset file shall be named in the style of | |
72 | <priority>\-<program>\&.conf\&. Files in | |
73 | /etc/ | |
74 | override files with the same name in | |
75 | /usr/lib/ | |
76 | and | |
77 | /run/\&. Files in | |
78 | /run/ | |
79 | override files with the same name in | |
80 | /usr/lib/\&. Packages should install their preset files in | |
81 | /usr/lib/\&. Files in | |
82 | /etc/ | |
60f067b4 | 83 | 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 lexicographic order, regardless of which of the directories they reside in\&. If multiple files specify the same unit name, the entry in the file with the lexicographically earliest name will be applied\&. It is recommended to prefix all filenames with a two\-digit number and a dash, to simplify the ordering of the files\&. |
14228c0d MB |
84 | .PP |
85 | If the administrator wants to disable a preset file supplied by the vendor, the recommended way is to place a symlink to | |
86 | /dev/null | |
87 | in | |
88 | /etc/systemd/system\-preset/ | |
89 | bearing the same filename\&. | |
90 | .SH "EXAMPLE" | |
91 | .PP | |
92 | \fBExample\ \&1.\ \&Default off example /usr/lib/systemd/system\-preset/99\-default\&.preset:\fR | |
93 | .sp | |
94 | .if n \{\ | |
95 | .RS 4 | |
96 | .\} | |
97 | .nf | |
98 | disable * | |
99 | .fi | |
100 | .if n \{\ | |
101 | .RE | |
102 | .\} | |
103 | .PP | |
104 | This disables all units\&. Due to the filename prefix | |
105 | "99\-", it will be read last and hence can easily be overridden by spin or administrator preset policy or suchlike\&. | |
106 | .PP | |
107 | \fBExample\ \&2.\ \&A GNOME spin example /usr/lib/systemd/system\-preset/50\-gnome\&.preset:\fR | |
108 | .sp | |
109 | .if n \{\ | |
110 | .RS 4 | |
111 | .\} | |
112 | .nf | |
113 | enable gdm\&.service | |
114 | enable colord\&.service | |
115 | enable accounts\-daemon\&.service | |
116 | enable avahi\-daemon\&.* | |
117 | .fi | |
118 | .if n \{\ | |
119 | .RE | |
120 | .\} | |
121 | .PP | |
122 | This enables the three mentioned units, plus all | |
123 | avahi\-daemon | |
124 | 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\&. | |
125 | .PP | |
126 | \fBExample\ \&3.\ \&Administrator policy /etc/systemd/system\-preset/00\-lennart\&.preset:\fR | |
127 | .sp | |
128 | .if n \{\ | |
129 | .RS 4 | |
130 | .\} | |
131 | .nf | |
132 | enable httpd\&.service | |
133 | enable sshd\&.service | |
134 | enable postfix\&.service | |
135 | disable * | |
136 | .fi | |
137 | .if n \{\ | |
138 | .RE | |
139 | .\} | |
140 | .PP | |
141 | 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 filename prefix | |
142 | "00\-" | |
143 | it will be read early and hence overrides all other preset policy files\&. | |
144 | .SH "SEE ALSO" | |
145 | .PP | |
146 | \fBsystemd\fR(1), | |
147 | \fBsystemctl\fR(1), | |
148 | \fBsystemd-delta\fR(1) | |
149 | .SH "NOTES" | |
150 | .IP " 1." 4 | |
151 | Presets | |
152 | .RS 4 | |
153 | \%http://freedesktop.org/wiki/Software/systemd/Preset | |
154 | .RE |