[OE-core] [PATCH 1/1] systemd: Don't create /var/tmp, log directories

Andrei Gherzan andrei at gherzan.ro
Fri Jan 16 13:38:43 UTC 2015


/var/tmp and /var/log are symlinks created by base-files and point to their
respective directories in /var/volatile.
With this patch we avoid systemd-tmpfiles runtime errors like:
systemd-tmpfiles[108]: chmod(/var/tmp) failed: No such file or directory

Signed-off-by: Andrei Gherzan <andrei.gherzan at windriver.com>
---
 .../0001-tmpfiles-Don-t-create-var-tmp-log.patch   | 42 ++++++++++++++++++++++
 meta/recipes-core/systemd/systemd_216.bb           |  1 +
 2 files changed, 43 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-tmpfiles-Don-t-create-var-tmp-log.patch

diff --git a/meta/recipes-core/systemd/systemd/0001-tmpfiles-Don-t-create-var-tmp-log.patch b/meta/recipes-core/systemd/systemd/0001-tmpfiles-Don-t-create-var-tmp-log.patch
new file mode 100644
index 0000000..a47b58d
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-tmpfiles-Don-t-create-var-tmp-log.patch
@@ -0,0 +1,42 @@
+From f5738e5bc4e96672244d77cb6fcbdc0697d49961 Mon Sep 17 00:00:00 2001
+From: Andrei Gherzan <andrei.gherzan at windriver.com>
+Date: Fri, 16 Jan 2015 14:30:34 +0100
+Subject: [PATCH] tmpfiles: Don't create /var/tmp,log
+
+Signed-off-by: Andrei Gherzan <andrei.gherzan at windriver.com>
+---
+ tmpfiles.d/tmp.conf | 3 ++-
+ tmpfiles.d/var.conf | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tmpfiles.d/tmp.conf b/tmpfiles.d/tmp.conf
+index b80dab4..d5dfc8e 100644
+--- a/tmpfiles.d/tmp.conf
++++ b/tmpfiles.d/tmp.conf
+@@ -9,7 +9,8 @@
+ 
+ # Clear tmp directories separately, to make them easier to override
+ d /tmp 1777 root root 10d
+-d /var/tmp 1777 root root 30d
++# Already symlink to volatile/tmp from base-files
++#d /var/tmp 1777 root root 30d
+ 
+ # Exclude namespace mountpoints created with PrivateTmp=yes
+ x /tmp/systemd-private-%b-*
+diff --git a/tmpfiles.d/var.conf b/tmpfiles.d/var.conf
+index 4b63e41..fa74af1 100644
+--- a/tmpfiles.d/var.conf
++++ b/tmpfiles.d/var.conf
+@@ -11,7 +11,8 @@ d /var 0755 - - -
+ 
+ L /var/run - - - - ../run
+ 
+-d /var/log 0755 - - -
++# Already symlink to volatile/log from base-files
++#d /var/log 0755 - - -
+ f /var/log/wtmp 0664 root utmp -
+ f /var/log/btmp 0600 root utmp -
+ 
+-- 
+1.9.3
+
diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb
index 8e1b5aa..a7cac9d 100644
--- a/meta/recipes-core/systemd/systemd_216.bb
+++ b/meta/recipes-core/systemd/systemd_216.bb
@@ -35,6 +35,7 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
            file://0001-Make-root-s-home-directory-configurable.patch \
            file://0001-systemd-user-avoid-using-system-auth.patch \
            file://0001-journal-Fix-navigating-backwards-missing-entries.patch \
+           file://0001-tmpfiles-Don-t-create-var-tmp-log.patch \
            file://touchscreen.rules \
            file://00-create-volatile.conf \
            file://init \
-- 
1.9.3




More information about the Openembedded-core mailing list