]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/systemd.preset.xml
license: LGPL-2.1+ -> LGPL-2.1-or-later
[thirdparty/systemd.git] / man / systemd.preset.xml
index b7164014f05264bd1507664eaa1a47dccd28d9e1..5697e50be7c6de411eb298d203cb1c4b27033957 100644 (file)
@@ -1,38 +1,13 @@
 <?xml version="1.0"?>
 <!--*-nxml-*-->
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
-<!--
-  This file is part of systemd.
-
-  Copyright 2011 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
--->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
 <refentry id="systemd.preset">
 
   <refentryinfo>
     <title>systemd.preset</title>
     <productname>systemd</productname>
-
-    <authorgroup>
-      <author>
-        <contrib>Developer</contrib>
-        <firstname>Lennart</firstname>
-        <surname>Poettering</surname>
-        <email>lennart@poettering.net</email>
-      </author>
-    </authorgroup>
   </refentryinfo>
 
   <refmeta>
@@ -72,7 +47,7 @@
 
     <para>For more information on the preset logic please have a look
     at the <ulink
-    url="http://freedesktop.org/wiki/Software/systemd/Preset">Presets</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
     either the word <literal>enable</literal> or
     <literal>disable</literal> 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.</para>
+    Empty lines and lines whose first non-whitespace character is <literal>#</literal> or
+    <literal>;</literal> 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 <literal>@</literal>
+    and the unit suffix.</para>
+
+    <para>Presets must refer to the "real" unit file, and not to any aliases. See
+    <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+    for a description of unit aliasing.</para>
 
     <para>Two different directives are understood:
     <literal>enable</literal> may be used to enable units by default,
   </refsect1>
 
   <refsect1>
-    <title>Example</title>
+    <title>Examples</title>
 
     <example>
-      <title>Default off example <filename>/usr/lib/systemd/system-preset/99-default.preset</filename>:</title>
+      <title>Default to off</title>
 
-      <programlisting>disable *</programlisting>
+      <programlisting># /usr/lib/systemd/system-preset/99-default.preset
+
+disable *</programlisting>
     </example>
 
     <para>This disables all units. Due to the filename prefix
     <literal>99-</literal>, it will be read last and hence can easily
-    be overridden by spin or administrator preset policy or
-    suchlike.</para>
+    be overridden by spin or administrator preset policy.</para>
 
     <example>
-      <title>A GNOME spin example <filename>/usr/lib/systemd/system-preset/50-gnome.preset</filename>:</title>
+      <title>Enable multiple template instances</title>
 
-      <programlisting>enable gdm.service
+      <programlisting># /usr/lib/systemd/system-preset/80-dirsrv.preset
+
+enable dirsrv@.service foo bar baz</programlisting>
+    </example>
+
+    <para>This enables all three of <filename>dirsrv@foo.service</filename>,
+    <filename>dirsrv@bar.service</filename> and <filename>dirsrv@baz.service</filename>.</para>
+
+    <example>
+      <title>A GNOME spin</title>
+
+      <programlisting># /usr/lib/systemd/system-preset/50-gnome.preset
+
+enable gdm.service
 enable colord.service
 enable accounts-daemon.service
 enable avahi-daemon.*</programlisting>
@@ -162,9 +158,11 @@ enable avahi-daemon.*</programlisting>
     example like the one from the first example above.</para>
 
     <example>
-      <title>Administrator policy <filename>/etc/systemd/system-preset/00-lennart.preset</filename>:</title>
+      <title>Administrator policy</title>
+
+      <programlisting># /etc/systemd/system-preset/00-lennart.preset
 
-      <programlisting>enable httpd.service
+enable httpd.service
 enable sshd.service
 enable postfix.service
 disable *</programlisting>
@@ -173,8 +171,8 @@ disable *</programlisting>
     <para>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 <literal>00-</literal> it will be read early and hence
-    overrides all other preset policy files.</para>
+    prefix <literal>00-</literal> it will be read early and
+    override all other preset policy files.</para>
   </refsect1>
 
   <refsect1>