summaryrefslogtreecommitdiffstats
path: root/meta/classes/systemd.bbclass
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2016-11-24 23:17:14 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-11 17:21:43 +0000
commitd87772571f747f60a9b2540e3f2cbd91616119b7 (patch)
tree17ceb23cfeecddb544471c10a3da6e46c8c1572d /meta/classes/systemd.bbclass
parentcebbc4372ae5b62ed38af4f3100174f321bcb1e6 (diff)
downloadpoky-d87772571f747f60a9b2540e3f2cbd91616119b7.tar.gz
systemd.bbclass: don't block on service restart
The current class works fine when a recipe uses SYSTEMD_AUTO_ENABLE 'enable' and has no on device pkg_postinst(), ie when the postinst is run as part of rootfs creation. However, when there is a component of pkg_postinst() that is run on device the 'systemctl restart' is run as part of the run_postinsts.service at boot. This results in the boot spinning indefinitely with: [ *** ] A start job is running for Run pending postinsts (7s / no limit) The issue could potentially be that the packages service has an 'After' clause which comes later in the boot, beyond run_postinsts.service, creating a chicken before the egg scenario. Even service files without an 'After' clause cause this situation however. Despite this not being the cause of the issue this fix will prevent this scenario from happenning. Using strace we are able to find that during boot, when run_postinsts.service is running attempting to start or restart any service will result in the call get stuck on poll(). Since the run_postinsts.service does not monitor the outcome of the call to restart we can work around this by using '--no-block'. (From OE-Core rev: 6ad6a0084a73088fc2a27ab9958e5c46d6e094fc) (From OE-Core rev: caad8aa89f9815a278e39296497596996a35fe95) Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/systemd.bbclass')
-rw-r--r--meta/classes/systemd.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index d56c760a17..4ea1f45e97 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -32,7 +32,7 @@ if type systemctl >/dev/null 2>/dev/null; then
32 systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE} 32 systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
33 33
34 if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then 34 if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
35 systemctl restart ${SYSTEMD_SERVICE} 35 systemctl --no-block restart ${SYSTEMD_SERVICE}
36 fi 36 fi
37fi 37fi
38} 38}