Skip to contentSkip to conversation

dbus: mask the dbus-1 init script if using systemd

PATCH New Ross Burton 1 participant 2 messages Feb 6, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dbus: mask the dbus-1 init script if using systemd

If the image is built with both systemd and sysvinit there'll be a dbus-1 init script and a dbus service. This means systemd can try and launch both, which won't work.

There's a systemctl mask to stop this in systemd-compat-units, but the logical place for it to be is in the dbus recipe so it can't be left out of an image.

---
 meta/recipes-core/dbus/dbus.inc |    8 ++++++++
 1 file changed, 8 insertions(+)
meta/recipes-core/dbus/dbus.inc +8 -0
index cf17b62..db47ede 100644
@@ -62,6 +62,14 @@ RRECOMMENDS_${PN}-lib = "${PN}"
 FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
 
 pkg_postinst_dbus() {
+	# If both systemd and sysvinit are enabled, mask the dbus-1 init script
+        if ${@base_contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask dbus-1.service
+	fi
+
 	if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
 		/etc/init.d/populate-volatile.sh update
 	fi
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 2/2 systemd-compat-units: don't mask dbus, the recipe does this itself

---
 meta/recipes-core/systemd/systemd-compat-units.bb |    1 -
 1 file changed, 1 deletion(-)
meta/recipes-core/systemd/systemd-compat-units.bb +0 -1
index e653470..fe4c50c 100644
@@ -16,7 +16,6 @@ SYSTEMD_DISABLED_SYSV_SERVICES = " \
   hwclock \
   networking \
   syslog.busybox \
-  dbus-1 \
 "
 
 pkg_postinst_${PN} () {
Signature · 1 line
1.7.10.4