Skip to contentSkip to conversation

systemd-systemctl-native: Add additional messages for better debugging

PATCH New Andreas Müller 1 participant 2 messages May 26, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 systemd-systemctl-native: Add additional messages for better debugging

These messages helped me to fix the breakage of networkmanager/systemd

---
 .../systemd/systemd-systemctl-native.bb            |    2 +-
 .../systemd/systemd-systemctl-native/systemctl     |    5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)
meta-oe/recipes-core/systemd/systemd-systemctl-native.bb +1 -1
index 78eb8f3..7ca77ae 100644
@@ -3,7 +3,7 @@ DESCRIPTION = "Wrapper to enable of systemd services"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
 
-PR = "r2"
+PR = "r3"
 
 inherit native
 
meta-oe/recipes-core/systemd/systemd-systemctl-native/systemctl +5 -0
index 6e7a05d..ff9e6a7 100755
@@ -1,4 +1,5 @@
 #!/bin/sh
+echo "Started $0 $*"
 
 ROOT=
 
@@ -42,6 +43,7 @@ while [ $# != 0 ]; do
 done
 
 for service in $services; do
+	echo "Try to find location of $service..."
 	# find service file
 	for p in $ROOT/etc/systemd/system \
 		 $ROOT/lib/systemd/system \
@@ -55,6 +57,7 @@ for service in $services; do
 		echo "'$service' couldn't be found; exiting with error"
 		exit 1
 	fi
+	echo "Found $service in $service_file"
 
 	# create the required symbolic links
 	wanted_by=$(grep WantedBy $ROOT/$service_file \
@@ -63,6 +66,7 @@ for service in $services; do
 		        | grep '\.target$')
 
 	for r in $wanted_by; do
+		echo "WantedBy=$r found in $service"
 		if [ "$action" = "enable" ]; then
 			mkdir -p $ROOT/etc/systemd/system/$r.wants
 			ln -s $service_file $ROOT/etc/systemd/system/$r.wants
@@ -79,6 +83,7 @@ for service in $services; do
 		   | sed 's,Also=,,g' \
 		   | tr ',' '\n')
 	for a in $also; do
+		echo "Also=$a found in $service"
 		if [ "$action" = "enable" ]; then
 			$0 --root=$ROOT enable $a
 		fi
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 2/2 systemd.bbclass: Unbreak systemd support for recipes with SYSTEMD_SERVICE without extension

To set service files the following syntax is allowed:

SYSTEMD_SERVICE = <service_file>
or
SYSTEMD_SERVICE_{<systemd_package_name>} = <service_file>

First option was broken by

author Martin Jansa <[email protected]> 2012-04-24 13:11:44 (GMT)
commit 154d0bb399ce6a0bdc2bf756d1a8a9c77dd0a755
systemd.bbclass: allow recipe to inherit systemd with empty SYSTEMD_SERVICE

The error was discoverd for networkmanager.

---
 meta-oe/classes/systemd.bbclass |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
meta-oe/classes/systemd.bbclass +2 -1
index 1edd1e4..c04b71a 100644
@@ -190,7 +190,8 @@ python populate_packages_prepend () {
 	# run all modifications once when creating package
 	if os.path.exists('${D}'):
 		for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
-			if d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1) and d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1).strip():
+			systemd_services = d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1) or d.getVar('SYSTEMD_SERVICE', 1) or ""
+			if systemd_services != "":
 				systemd_generate_package_scripts(pkg_systemd)
 				systemd_add_rdepends(pkg_systemd)
 		systemd_check_services()
Signature · 1 line
1.7.4.4