]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: split tmp.conf out
authorFranck Bui <fbui@suse.com>
Fri, 12 Apr 2019 12:45:53 +0000 (14:45 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 13 Apr 2019 10:07:03 +0000 (12:07 +0200)
tmp.conf was dealing with 2 different kind of paths: one dealing with general
temporary paths such as /var/tmp and /tmp and the other one dealing with
temporary directories owned by systemd.

If for example a user wants to adjust the age argument of the general paths
only, he had to overload the whole file which is cumbersome and error prone
since any future changes in tmp.conf shipped by systemd will be lost.

So this patch splits out tmp.conf so the systemd directories are dealt
separately in a dedicated conf file. It's named "systemd-tmp.conf" based on the
naming recommendation made in tmpfiles.d man page.

In practice it shouldn't cause any regression since it's very unlikely that
users override paths owned by systemd.

tmpfiles.d/meson.build
tmpfiles.d/systemd-tmp.conf [new file with mode: 0644]
tmpfiles.d/tmp.conf

index 35eea2be5c804da3fde53a856ca587fea0af2c7f..b94a9d0f47711d40a8a1b6c519e099afff0d5809 100644 (file)
@@ -6,6 +6,7 @@ tmpfiles = [['home.conf',            ''],
             ['journal-nocow.conf',   ''],
             ['systemd-nologin.conf', ''],
             ['systemd-nspawn.conf',  'ENABLE_MACHINED'],
+            ['systemd-tmp.conf',     ''],
             ['portables.conf',       'ENABLE_PORTABLED'],
             ['tmp.conf',             ''],
             ['x11.conf',             ''],
diff --git a/tmpfiles.d/systemd-tmp.conf b/tmpfiles.d/systemd-tmp.conf
new file mode 100644 (file)
index 0000000..beb77dd
--- /dev/null
@@ -0,0 +1,18 @@
+#  This file is part of systemd.
+#
+#  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.
+
+# See tmpfiles.d(5) for details
+
+# Exclude namespace mountpoints created with PrivateTmp=yes
+x /tmp/systemd-private-%b-*
+X /tmp/systemd-private-%b-*/tmp
+x /var/tmp/systemd-private-%b-*
+X /var/tmp/systemd-private-%b-*/tmp
+
+# Remove top-level private temporary directories on each boot
+R! /tmp/systemd-private-*
+R! /var/tmp/systemd-private-*
index 22555a0076d7fae9dbc59d783dfb453849df03b4..fe5225d751c9d9f37363dcd5dcae407fc952675c 100644 (file)
 # Clear tmp directories separately, to make them easier to override
 q /tmp 1777 root root 10d
 q /var/tmp 1777 root root 30d
-
-# Exclude namespace mountpoints created with PrivateTmp=yes
-x /tmp/systemd-private-%b-*
-X /tmp/systemd-private-%b-*/tmp
-x /var/tmp/systemd-private-%b-*
-X /var/tmp/systemd-private-%b-*/tmp
-
-# Remove top-level private temporary directories on each boot
-R! /tmp/systemd-private-*
-R! /var/tmp/systemd-private-*