Patchwork [for-denzil,meta-oe] systemd: cleanup /var/run on boot and create /var/run/utmp

login
register
mail settings
Submitter Koen Kooi
Date Aug. 7, 2012, 7:48 a.m.
Message ID <1344325724-21149-1-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/34025/
State Accepted, archived
Headers show

Comments

Koen Kooi - Aug. 7, 2012, 7:48 a.m.
From: Martin Jansa <martin.jansa@gmail.com>

* Angstrom uses /var/run cleanup because:
  Some apps (e.g. avahi-daemon) to clean up their old-style pid files and fail
  to start every other boot. Se we let systemd clean it on boot.
  Which seems general enough, so lets move var-run.conf from base-files.bbappend
  to systemd recipe.

* /var/run/utmp was created by volatiles before, but without sysvinit installed
  systemd-update-utmp-runlevel.service fails to start without this file

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/recipes-core/systemd/systemd/var-run.conf |    4 ++++
 meta-oe/recipes-core/systemd/systemd_git.bb       |    5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-core/systemd/systemd/var-run.conf

Patch

diff --git a/meta-oe/recipes-core/systemd/systemd/var-run.conf b/meta-oe/recipes-core/systemd/systemd/var-run.conf
new file mode 100644
index 0000000..c2c18e2
--- /dev/null
+++ b/meta-oe/recipes-core/systemd/systemd/var-run.conf
@@ -0,0 +1,4 @@ 
+# empty /var/run
+R	/var/run/*	-	-	-	-	-
+# systemd-update-utmp-runlevel.service fails to start without this
+f /var/run/utmp 0644 root root - -
diff --git a/meta-oe/recipes-core/systemd/systemd_git.bb b/meta-oe/recipes-core/systemd/systemd_git.bb
index f4ca72a..b9c8a19 100644
--- a/meta-oe/recipes-core/systemd/systemd_git.bb
+++ b/meta-oe/recipes-core/systemd/systemd_git.bb
@@ -14,7 +14,7 @@  inherit gitpkgv
 PKGV = "v${GITPKGVTAG}"
 
 PV = "git"
-PR = "r27"
+PR = "r28"
 
 inherit useradd pkgconfig autotools vala perlnative
 
@@ -22,6 +22,7 @@  SRCREV = "3eff4208ffecedd778fec260f0d4b18e94dab443"
 
 SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;protocol=git \
            ${UCLIBCPATCHES} \
+           file://var-run.conf \
           "
 UCLIBCPATCHES = ""
 UCLIBCPATCHES_libc-uclibc = "file://paper-over-mkostemp.patch \
@@ -68,6 +69,8 @@  do_install() {
 	# create machine-id
 	# 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable
 	touch ${D}${sysconfdir}/machine-id
+
+	install -m 0644 ${WORKDIR}/var-run.conf ${D}${sysconfdir}/tmpfiles.d/
 }
 
 python populate_packages_prepend (){