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

login
register
mail settings
Submitter Martin Jansa
Date July 21, 2012, 8:05 a.m.
Message ID <a27cd747e1e87482d4968348fd9edd64c8c80925.1342857860.git.Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/32779/
State Accepted
Commit 3c488a49b512afd25c4b696e7b688af516dc6513
Headers show

Comments

Martin Jansa - July 21, 2012, 8:05 a.m.
* 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>
---
 .../recipes-core/systemd/systemd/var-run.conf      |    4 ++++
 meta-systemd/recipes-core/systemd/systemd_git.bb   |    5 ++++-
 2 files changed, 8 insertions(+), 1 deletions(-)
 create mode 100644 meta-systemd/recipes-core/systemd/systemd/var-run.conf

Patch

diff --git a/meta-systemd/recipes-core/systemd/systemd/var-run.conf b/meta-systemd/recipes-core/systemd/systemd/var-run.conf
new file mode 100644
index 0000000..c2c18e2
--- /dev/null
+++ b/meta-systemd/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-systemd/recipes-core/systemd/systemd_git.bb b/meta-systemd/recipes-core/systemd/systemd_git.bb
index 9cbdd76..3868438 100644
--- a/meta-systemd/recipes-core/systemd/systemd_git.bb
+++ b/meta-systemd/recipes-core/systemd/systemd_git.bb
@@ -19,7 +19,7 @@  inherit gitpkgv
 PKGV = "v${GITPKGVTAG}"
 
 PV = "git"
-PR = "r2"
+PR = "r3"
 
 inherit useradd pkgconfig autotools vala perlnative
 
@@ -29,6 +29,7 @@  SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;protocol=git \
            file://gtk-doc.make \
            file://touchscreen.rules \
            file://modprobe.rules \
+           file://var-run.conf \
           "
 LDFLAGS_libc-uclibc_append = " -lrt"
 
@@ -82,6 +83,8 @@  do_install() {
 	touch ${D}${sysconfdir}/machine-id
 
 	install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
+
+	install -m 0644 ${WORKDIR}/var-run.conf ${D}${sysconfdir}/tmpfiles.d/
 }
 
 python populate_packages_prepend (){