richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
572a44
From b2d9ad357e136b289238eb05648c504d0c0bc06b Mon Sep 17 00:00:00 2001
572a44
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
572a44
Date: Tue, 24 Dec 2013 10:21:45 -0500
572a44
Subject: [PATCH] man,units: tmpfiles.d(5) cleanup
572a44
572a44
Condition for /lib (necessary for split /usr) was missing from the unit.
572a44
572a44
Some changes which were done in tmpfiles.d(5) were not carried over to
572a44
systemd-tmpfiles(1).
572a44
572a44
Also use markup where possible.
572a44
572a44
Conflicts:
572a44
	man/tmpfiles.d.xml
572a44
---
572a44
 man/systemd-tmpfiles.xml                |  53 ++++++----
572a44
 man/tmpfiles.d.xml                      | 168 +++++++++++++++++++-------------
572a44
 units/systemd-tmpfiles-setup.service.in |   1 +
572a44
 3 files changed, 134 insertions(+), 88 deletions(-)
572a44
572a44
diff --git a/man/systemd-tmpfiles.xml b/man/systemd-tmpfiles.xml
572a44
index ba727e1..91c0372 100644
572a44
--- a/man/systemd-tmpfiles.xml
572a44
+++ b/man/systemd-tmpfiles.xml
572a44
@@ -54,7 +54,9 @@
572a44
 
572a44
         <refsynopsisdiv>
572a44
                 <cmdsynopsis>
572a44
-                        <command>systemd-tmpfiles <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="opt" rep="repeat">CONFIGURATION FILE</arg></command>
572a44
+                        <command>systemd-tmpfiles</command>
572a44
+                        <arg choice="opt" rep="repeat">OPTIONS</arg>
572a44
+                        <arg choice="opt" rep="repeat"><replaceable>CONFIGFILE</replaceable></arg>
572a44
                 </cmdsynopsis>
572a44
 
572a44
                 <para><filename>systemd-tmpfiles-setup.service</filename></para>
572a44
@@ -67,22 +69,20 @@
572a44
                 <title>Description</title>
572a44
 
572a44
                 <para><command>systemd-tmpfiles</command> creates,
572a44
-                deletes and cleans up volatile and temporary files and
572a44
+                deletes, and cleans up volatile and temporary files and
572a44
                 directories, based on the configuration file format and
572a44
-                location specified in <citerefentry>
572a44
-                        <refentrytitle>tmpfiles.d</refentrytitle>
572a44
-                        <manvolnum>5</manvolnum>
572a44
-                </citerefentry>.</para>
572a44
+                location specified in
572a44
+                <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
572a44
+                </para>
572a44
 
572a44
                 <para>If invoked with no arguments, it applies all
572a44
                 directives from all configuration files. If one or
572a44
                 more filenames are passed on the command line, only
572a44
                 the directives in these files are applied. If only
572a44
                 the basename of a configuration file is specified,
572a44
-                all configuration directories as specified in <citerefentry>
572a44
-                        <refentrytitle>tmpfiles.d</refentrytitle>
572a44
-                        <manvolnum>5</manvolnum>
572a44
-                </citerefentry> are searched for a matching file.</para>
572a44
+                all configuration directories as specified in
572a44
+                <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
572a44
+                are searched for a matching file.</para>
572a44
         </refsect1>
572a44
 
572a44
         <refsect1>
572a44
@@ -94,12 +94,25 @@
572a44
 
572a44
                         <varlistentry>
572a44
                                 <term><option>--create</option></term>
572a44
-                                <listitem><para>If this option is passed, all
572a44
-                                files and directories marked with f,
572a44
-                                F, d, D in the configuration files are
572a44
-                                created. Files and directories marked with z,
572a44
-                                Z have their ownership, access mode and security
572a44
-                                labels set.</para></listitem>
572a44
+                                <listitem><para>If this option is
572a44
+                                passed, all files and directories
572a44
+                                marked with <varname>f</varname>,
572a44
+                                <varname>F</varname>,
572a44
+                                <varname>w</varname>,
572a44
+                                <varname>d</varname>,
572a44
+                                <varname>D</varname>,
572a44
+                                <varname>p</varname>,
572a44
+                                <varname>L</varname>,
572a44
+                                <varname>c</varname>,
572a44
+                                <varname>b</varname>,
572a44
+                                <varname>m</varname> in the
572a44
+                                configuration files are created or
572a44
+                                written to. Files and directories
572a44
+                                marked with <varname>z</varname>,
572a44
+                                <varname>Z</varname>,
572a44
+                                <varname>m</varname> have their
572a44
+                                ownership, access mode and security
572a44
+                                labels set. </para></listitem>
572a44
                         </varlistentry>
572a44
 
572a44
                         <varlistentry>
572a44
@@ -113,9 +126,11 @@
572a44
                         <varlistentry>
572a44
                                 <term><option>--remove</option></term>
572a44
                                 <listitem><para>If this option is
572a44
-                                passed, all files and directories marked
572a44
-                                with r, R in the configuration files
572a44
-                                are removed.</para></listitem>
572a44
+                                passed, all files and directories
572a44
+                                marked with <varname>r</varname>,
572a44
+                                <varname>R</varname> in the
572a44
+                                configuration files are
572a44
+                                removed.</para></listitem>
572a44
                         </varlistentry>
572a44
                         <varlistentry>
572a44
                                 <term><option>--prefix=PATH</option></term>
572a44
diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml
572a44
index e8b630d..a00637b 100644
572a44
--- a/man/tmpfiles.d.xml
572a44
+++ b/man/tmpfiles.d.xml
572a44
@@ -67,23 +67,32 @@
572a44
                 <title>Configuration Format</title>
572a44
 
572a44
                 <para>Each configuration file shall be named in the
572a44
-                style of <filename><package>.conf</filename>.
572a44
-                Files in <filename>/etc/</filename> override files
572a44
-                with the same name in <filename>/usr/lib/</filename>
572a44
-                and <filename>/run/</filename>.  Files in
572a44
-                <filename>/run/</filename> override files with the same
572a44
-                name in <filename>/usr/lib/</filename>. Packages
572a44
+                style of
572a44
+                <filename><replaceable>package</replaceable>.conf</filename>
572a44
+                or
572a44
+                <filename><replaceable>package</replaceable>-<replaceable>part</replaceable>.conf</filename>.
572a44
+                The second variant should be used when it is desirable
572a44
+                to make it easy to override just this part of
572a44
+                configuration.</para>
572a44
+
572a44
+                <para>Files in <filename>/etc/tmpfiles.d</filename>
572a44
+                override files with the same name in
572a44
+                <filename>/usr/lib/tmpfiles.d</filename> and
572a44
+                <filename>/run/tmpfiles.d</filename>. Files in
572a44
+                <filename>/run/tmpfiles.d</filename> override files
572a44
+                with the same name in
572a44
+                <filename>/usr/lib/tmpfiles.d</filename>. Packages
572a44
                 should install their configuration files in
572a44
-                <filename>/usr/lib/</filename>. Files in
572a44
-                <filename>/etc/</filename> are reserved for the local
572a44
-                administrator, who may use this logic to override the
572a44
-                configuration files installed by vendor packages. All
572a44
-                configuration files are sorted by their filename in
572a44
-                lexicographic order, regardless in which of the
572a44
-                directories they reside. If multiple files specify the
572a44
-                same path, the entry in the file with the lexicographically
572a44
-                earliest name will be applied, all all other conflicting
572a44
-                entries logged as errors.</para>
572a44
+                <filename>/usr/lib/tmpfiles.d</filename>. Files in
572a44
+                <filename>/etc/tmpfiles.d</filename> are reserved for
572a44
+                the local administrator, who may use this logic to
572a44
+                override the configuration files installed by vendor
572a44
+                packages. All configuration files are sorted by their
572a44
+                filename in lexicographic order, regardless in which
572a44
+                of the directories they reside. If multiple files
572a44
+                specify the same path, the entry in the file with the
572a44
+                lexicographically earliest name will be applied, all
572a44
+                all other conflicting entries logged as errors.</para>
572a44
 
572a44
                 <para>If the administrator wants to disable a
572a44
                 configuration file supplied by the vendor, the
572a44
@@ -93,10 +102,10 @@
572a44
                 same filename.</para>
572a44
 
572a44
                 <para>The configuration format is one line per path
572a44
-                containing action, path, mode, ownership, age and argument
572a44
+                containing type, path, mode, ownership, age, and argument
572a44
                 fields:</para>
572a44
 
572a44
-                <programlisting>Type Path        Mode UID  GID  Age Argument
572a44
+                <programlisting>#Type Path        Mode UID  GID  Age Argument
572a44
 d    /run/user   0755 root root 10d -
572a44
 L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
572a44
 
572a44
@@ -109,12 +118,12 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
572a44
                         <variablelist>
572a44
                                 <varlistentry>
572a44
                                         <term><varname>f</varname></term>
572a44
-                                        <listitem><para>Create a file if it does not exist yet (optionally writing a short string into it, if the argument parameter is passed)</para></listitem>
572a44
+                                        <listitem><para>Create a file if it does not exist yet. If the argument parameter is given, it will be written to the file.</para></listitem>
572a44
                                 </varlistentry>
572a44
 
572a44
                                 <varlistentry>
572a44
                                         <term><varname>F</varname></term>
572a44
-                                        <listitem><para>Create or truncate a file (optionally writing a short string into it, if the argument parameter is passed)</para></listitem>
572a44
+                                        <listitem><para>Create or truncate a file. If the argument parameter is given, it will be written to the file.</para></listitem>
572a44
                                 </varlistentry>
572a44
 
572a44
                                 <varlistentry>
572a44
@@ -127,32 +136,32 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
572a44
 
572a44
                                 <varlistentry>
572a44
                                         <term><varname>d</varname></term>
572a44
-                                        <listitem><para>Create a directory if it does not exist yet</para></listitem>
572a44
+                                        <listitem><para>Create a directory if it does not exist yet.</para></listitem>
572a44
                                 </varlistentry>
572a44
 
572a44
                                 <varlistentry>
572a44
                                         <term><varname>D</varname></term>
572a44
-                                        <listitem><para>Create or empty a directory</para></listitem>
572a44
+                                        <listitem><para>Create or empty a directory.</para></listitem>
572a44
                                 </varlistentry>
572a44
 
572a44
                                 <varlistentry>
572a44
                                         <term><varname>p</varname></term>
572a44
-                                        <listitem><para>Create a named pipe (FIFO) if it does not exist yet</para></listitem>
572a44
+                                        <listitem><para>Create a named pipe (FIFO) if it does not exist yet.</para></listitem>
572a44
                                 </varlistentry>
572a44
 
572a44
                                 <varlistentry>
572a44
                                         <term><varname>L</varname></term>
572a44
-                                        <listitem><para>Create a symlink if it does not exist yet</para></listitem>
572a44
+                                        <listitem><para>Create a symlink if it does not exist yet.</para></listitem>
572a44
                                 </varlistentry>
572a44
 
572a44
                                 <varlistentry>
572a44
                                         <term><varname>c</varname></term>
572a44
-                                        <listitem><para>Create a character device node if it does not exist yet</para></listitem>
572a44
+                                        <listitem><para>Create a character device node if it does not exist yet.</para></listitem>
572a44
                                 </varlistentry>
572a44
 
572a44
                                 <varlistentry>
572a44
                                         <term><varname>b</varname></term>
572a44
-                                        <listitem><para>Create a block device node if it does not exist yet</para></listitem>
572a44
+                                        <listitem><para>Create a block device node if it does not exist yet.</para></listitem>
572a44
                                 </varlistentry>
572a44
 
572a44
                                 <varlistentry>
572a44
@@ -174,11 +183,12 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
572a44
                                         as controlled with the Age
572a44
                                         parameter. Note that lines of
572a44
                                         this type do not influence the
572a44
-                                        effect of r or R lines. Lines
572a44
-                                        of this type accept
572a44
+                                        effect of <varname>r</varname>
572a44
+                                        or <varname>R</varname> lines.
572a44
+                                        Lines of this type accept
572a44
                                         shell-style globs in place of
572a44
-                                        normal path
572a44
-                                        names.</para></listitem>
572a44
+                                        normal path names.
572a44
+                                        </para></listitem>
572a44
                                 </varlistentry>
572a44
 
572a44
                                 <varlistentry>
572a44
@@ -187,28 +197,31 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
572a44
                                         during cleaning. Use this type
572a44
                                         to exclude paths from clean-up
572a44
                                         as controlled with the Age
572a44
-                                        parameter. Unlike x this
572a44
+                                        parameter. Unlike
572a44
+                                        <varname>x</varname>, this
572a44
                                         parameter will not exclude the
572a44
-                                        content if path is a directory,
572a44
-                                        but only directory itself.
572a44
-                                        Note that lines of this type do
572a44
-                                        not influence the effect of r
572a44
-                                        or R lines. Lines of this type
572a44
-                                        accept shell-style globs in
572a44
-                                        place of normal path
572a44
-                                        names.</para></listitem>
572a44
+                                        content if path is a
572a44
+                                        directory, but only directory
572a44
+                                        itself. Note that lines of
572a44
+                                        this type do not influence the
572a44
+                                        effect of <varname>r</varname>
572a44
+                                        or <varname>R</varname> lines.
572a44
+                                        Lines of this type accept
572a44
+                                        shell-style globs in place of
572a44
+                                        normal path names.
572a44
+                                        </para></listitem>
572a44
                                 </varlistentry>
572a44
 
572a44
                                 <varlistentry>
572a44
                                         <term><varname>r</varname></term>
572a44
                                         <listitem><para>Remove a file
572a44
-                                        or directory if it
572a44
-                                        exists. This may not be used
572a44
-                                        to remove non-empty
572a44
-                                        directories, use R for
572a44
-                                        that. Lines of this type
572a44
-                                        accept shell-style globs in
572a44
-                                        place of normal path
572a44
+                                        or directory if it exists.
572a44
+                                        This may not be used to remove
572a44
+                                        non-empty directories, use
572a44
+                                        <varname>R</varname> for that.
572a44
+                                        Lines of this type accept
572a44
+                                        shell-style globs in place of
572a44
+                                        normal path
572a44
                                         names.</para></listitem>
572a44
                                 </varlistentry>
572a44
 
572a44
@@ -308,11 +321,14 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
572a44
                         <para>The file access mode to use when
572a44
                         creating this file or directory. If omitted or
572a44
                         when set to -, the default is used: 0755 for
572a44
-                        directories, 0644 for all other file
572a44
-                        objects. For z, Z lines, if omitted or when set
572a44
-                        to -, the file access mode will not be
572a44
-                        modified. This parameter is ignored for x, r,
572a44
-                        R, L lines.</para>
572a44
+                        directories, 0644 for all other file objects.
572a44
+                        For <varname>z</varname>, <varname>Z</varname>
572a44
+                        lines, if omitted or when set to
572a44
+                        <literal>-</literal>, the file access mode
572a44
+                        will not be modified. This parameter is
572a44
+                        ignored for <varname>x</varname>,
572a44
+                        <varname>r</varname>, <varname>R</varname>,
572a44
+                        <varname>L</varname> lines.</para>
572a44
                 </refsect2>
572a44
 
572a44
                 <refsect2>
572a44
@@ -321,10 +337,15 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
572a44
                         <para>The user and group to use for this file
572a44
                         or directory. This may either be a numeric
572a44
                         user/group ID or a user or group name. If
572a44
-                        omitted or when set to -, the default 0 (root)
572a44
-                        is used. For z, Z lines, when omitted or when set to -,
572a44
-                        the file ownership will not be modified.
572a44
-                        These parameters are ignored for x, r, R, L lines.</para>
572a44
+                        omitted or when set to <literal>-</literal>,
572a44
+                        the default 0 (root) is used. For
572a44
+                        <varname>z</varname>, <varname>Z</varname>
572a44
+                        lines, when omitted or when set to -, the file
572a44
+                        ownership will not be modified. These
572a44
+                        parameters are ignored for
572a44
+                        <varname>x</varname>, <varname>r</varname>,
572a44
+                        <varname>R</varname>, <varname>L</varname>
572a44
+                        lines.</para>
572a44
                 </refsect2>
572a44
 
572a44
                 <refsect2>
572a44
@@ -357,28 +378,37 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
572a44
                         <para>When the age is set to zero, the files are cleaned
572a44
                         unconditionally.</para>
572a44
 
572a44
-                        <para>The age field only applies to lines starting with
572a44
-                        d, D and x. If omitted or set to -, no automatic clean-up
572a44
-                        is done.</para>
572a44
+                        <para>The age field only applies to lines
572a44
+                        starting with <varname>d</varname>,
572a44
+                        <varname>D</varname>, and
572a44
+                        <varname>x</varname>. If omitted or set to
572a44
+                        <literal>-</literal>, no automatic clean-up is
572a44
+                        done.</para>
572a44
 
572a44
                         <para>If the age field starts with a tilde
572a44
-                        character (~), the clean-up is only applied to
572a44
-                        files and directories one level inside the
572a44
-                        directory specified, but not the files and
572a44
-                        directories immediately inside it.</para>
572a44
+                        character <literal>~</literal>, the clean-up
572a44
+                        is only applied to files and directories one
572a44
+                        level inside the directory specified, but not
572a44
+                        the files and directories immediately inside
572a44
+                        it.</para>
572a44
                 </refsect2>
572a44
 
572a44
                 <refsect2>
572a44
                         <title>Argument</title>
572a44
 
572a44
-                        <para>For L lines determines the destination
572a44
-                        path of the symlink. For c, b determines the
572a44
+                        <para>For <varname>L</varname> lines
572a44
+                        determines the destination path of the
572a44
+                        symlink. For <varname>c</varname>,
572a44
+                        <varname>b</varname> determines the
572a44
                         major/minor of the device node, with major and
572a44
-                        minor formatted as integers, separated by :,
572a44
-                        e.g. "1:3". For f, F, w may be used to specify
572a44
-                        a short string that is written to the file,
572a44
-                        suffixed by a newline. Ignored for all other
572a44
-                        lines.</para>
572a44
+                        minor formatted as integers, separated by
572a44
+                        <literal>:</literal>, e.g.
572a44
+                        <literal>1:3</literal>. For
572a44
+                        <varname>f</varname>, <varname>F</varname>,
572a44
+                        and <varname>w</varname> may be used to
572a44
+                        specify a short string that is written to the
572a44
+                        file, suffixed by a newline. Ignored for all
572a44
+                        other lines.</para>
572a44
                 </refsect2>
572a44
 
572a44
         </refsect1>
572a44
diff --git a/units/systemd-tmpfiles-setup.service.in b/units/systemd-tmpfiles-setup.service.in
572a44
index 6f98063..3405e28 100644
572a44
--- a/units/systemd-tmpfiles-setup.service.in
572a44
+++ b/units/systemd-tmpfiles-setup.service.in
572a44
@@ -14,6 +14,7 @@ Conflicts=shutdown.target
572a44
 After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target
572a44
 Before=sysinit.target shutdown.target
572a44
 ConditionDirectoryNotEmpty=|/usr/lib/tmpfiles.d
572a44
+ConditionDirectoryNotEmpty=|/lib/tmpfiles.d
572a44
 ConditionDirectoryNotEmpty=|/usr/local/lib/tmpfiles.d
572a44
 ConditionDirectoryNotEmpty=|/etc/tmpfiles.d
572a44
 ConditionDirectoryNotEmpty=|/run/tmpfiles.d