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