276 lines
7.0 KiB
HTML
276 lines
7.0 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SYSTEMD.PRESET</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SYSTEMD.PRESET</H1>
|
|
Section: systemd.preset (5)<BR>Updated: <BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
systemd.preset - Service enablement presets
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
|
|
/etc/systemd/system-preset/*.preset
|
|
<P>
|
|
|
|
/run/systemd/system-preset/*.preset
|
|
<P>
|
|
|
|
/lib/systemd/system-preset/*.preset
|
|
<P>
|
|
|
|
/etc/systemd/user-preset/*.preset
|
|
<P>
|
|
|
|
/run/systemd/user-preset/*.preset
|
|
<P>
|
|
|
|
/usr/lib/systemd/user-preset/*.preset
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
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
|
|
<B>systemctl preset</B>
|
|
(for more information see
|
|
<B><A HREF="/cgi-bin/man/man2html?1+systemctl">systemctl</A></B>(1)) which uses this information to enable or disable a unit according to preset policy.
|
|
<B>systemctl preset</B>
|
|
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.
|
|
<P>
|
|
|
|
For more information on the preset logic please have a look at the
|
|
m[blue]<B>Presets</B>m[]<FONT SIZE="-2">[1]</FONT>
|
|
document.
|
|
<P>
|
|
|
|
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.
|
|
<P>
|
|
|
|
If no preset files exist,
|
|
<B>systemctl preset</B>
|
|
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.)
|
|
<A NAME="lbAE"> </A>
|
|
<H2>PRESET FILE FORMAT</H2>
|
|
|
|
<P>
|
|
|
|
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. Multiple instance names for unit templates may be specified as a space separated list at the end of the line instead of the customary position between
|
|
"@"
|
|
and the unit suffix.
|
|
<P>
|
|
|
|
Presets must refer to the "real" unit file, and not to any aliases. See
|
|
<B><A HREF="/cgi-bin/man/man2html?5+systemd.unit">systemd.unit</A></B>(5)
|
|
for a description of unit aliasing.
|
|
<P>
|
|
|
|
Two different directives are understood:
|
|
"enable"
|
|
may be used to enable units by default,
|
|
"disable"
|
|
to disable units by default.
|
|
<P>
|
|
|
|
If multiple lines apply to a unit name, the first matching one takes precedence over all others.
|
|
<P>
|
|
|
|
Each preset file shall be named in the style of
|
|
<priority>-<policy-name>.preset. Files in
|
|
/etc/
|
|
override files with the same name in
|
|
/usr/lib/
|
|
and
|
|
/run/. Files in
|
|
/run/
|
|
override files with the same name in
|
|
/lib/. Packages should install their preset files in
|
|
/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 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.
|
|
<P>
|
|
|
|
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 filename.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
<P>
|
|
|
|
<B>Example 1. Default to off</B>
|
|
<P>
|
|
<DL COMPACT><DT id="1"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
# /lib/systemd/system-preset/99-default.preset
|
|
|
|
disable *
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
This disables all units. Due to the filename prefix
|
|
"99-", it will be read last and hence can easily be overridden by spin or administrator preset policy.
|
|
<P>
|
|
|
|
<B>Example 2. Enable multiple template instances</B>
|
|
<P>
|
|
<DL COMPACT><DT id="2"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
# /lib/systemd/system-preset/80-dirsrv.preset
|
|
|
|
enable <A HREF="mailto:dirsrv@.service">dirsrv@.service</A> foo bar baz
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
This enables all three of
|
|
<A HREF="mailto:dirsrv@foo.service">dirsrv@foo.service</A>,
|
|
<A HREF="mailto:dirsrv@bar.service">dirsrv@bar.service</A>
|
|
and
|
|
<A HREF="mailto:dirsrv@baz.service">dirsrv@baz.service</A>.
|
|
<P>
|
|
|
|
<B>Example 3. A GNOME spin</B>
|
|
<P>
|
|
<DL COMPACT><DT id="3"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
# /lib/systemd/system-preset/50-gnome.preset
|
|
|
|
enable gdm.service
|
|
enable colord.service
|
|
enable accounts-daemon.service
|
|
enable avahi-daemon.*
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
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.
|
|
<P>
|
|
|
|
<B>Example 4. Administrator policy</B>
|
|
<P>
|
|
<DL COMPACT><DT id="4"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
# /etc/systemd/system-preset/00-lennart.preset
|
|
|
|
enable httpd.service
|
|
enable sshd.service
|
|
enable postfix.service
|
|
disable *
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
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
|
|
"00-"
|
|
it will be read early and override all other preset policy files.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<P>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
|
|
<B><A HREF="/cgi-bin/man/man2html?1+systemctl">systemctl</A></B>(1),
|
|
<B><A HREF="/cgi-bin/man/man2html?1+systemd-delta">systemd-delta</A></B>(1)
|
|
<A NAME="lbAH"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="5"> 1.<DD>
|
|
Presets
|
|
<DL COMPACT><DT id="6"><DD>
|
|
<A HREF="https://www.freedesktop.org/wiki/Software/systemd/Preset">https://www.freedesktop.org/wiki/Software/systemd/Preset</A>
|
|
</DL>
|
|
|
|
<P>
|
|
</DL>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="7"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="8"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="9"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="10"><A HREF="#lbAE">PRESET FILE FORMAT</A><DD>
|
|
<DT id="11"><A HREF="#lbAF">EXAMPLES</A><DD>
|
|
<DT id="12"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
<DT id="13"><A HREF="#lbAH">NOTES</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:06 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|