Skip to contentSkip to conversation

systat: systemd never enables the service

PATCH Superseded Stefano Babic 2 participants 2 messages Jun 18, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systat: systemd never enables the service

Even if SYSTEMD_AUTO_ENABLE is set to "enable", the service is never activated by systemd. The cause is the postinst function in the recipe:

pkg_postinst_${PN} () {
if [ -n "$D" ]; then
exit 0
fi
if [ -e /etc/init.d/populate-volatile.sh ]; then
/etc/init.d/populate-volatile.sh update
fi
}

This generates with activated systemd the following postinst script:

	set -e
	        if [ -n "$D" ]; then
	                exit 0
	        fi
	        if [ -e /etc/init.d/populate-volatile.sh ]; then
	                /etc/init.d/populate-volatile.sh update
	        fi
	OPTS=""

	if [ -n "$D" ]; then
	    OPTS="--root=$D"
	fi

	if type systemctl >/dev/null 2>/dev/null; then
		if [ -z "$D" ]; then
			systemctl daemon-reload
		fi

		systemctl $OPTS enable sysstat.service

		if [ -z "$D" -a "enable" = "enable" ]; then
			systemctl --no-block restart sysstat.service
		fi
	fi

Due to the exit statement, systemctl is never called and the service is never enabled in rootfs.
Invert the logic for the check to let run the rest of postinst script.

---
 meta/recipes-extended/sysstat/sysstat.inc | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
meta/recipes-extended/sysstat/sysstat.inc +5 -6
index 0bc7e14d36..850a6d1465 100644
@@ -51,12 +51,11 @@ do_install() {
 }
 
 pkg_postinst_${PN} () {
-        if [ -n "$D" ]; then
-                exit 0
-        fi
-        if [ -e /etc/init.d/populate-volatile.sh ]; then
-                /etc/init.d/populate-volatile.sh update
-        fi
+	if [  ! -n "$D" ]; then
+		if [ -e /etc/init.d/populate-volatile.sh ]; then
+			/etc/init.d/populate-volatile.sh update
+		fi
+	fi
 }
 
 
Signature · 1 line
2.17.1
#1 lore raw

✗ patchtest: failure for systat: systemd never enables the service

== Series Details ==

Series: systat: systemd never enables the service
Revision: 1
URL : https://patchwork.openembedded.org/series/18199/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at ce69c21707)

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe