]> code.ossystems Code Review - openembedded-core.git/commit
systemd.bbclass: don't block on service restart
authorMark Asselstine <mark.asselstine@windriver.com>
Fri, 25 Nov 2016 04:17:14 +0000 (23:17 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 Nov 2016 15:47:14 +0000 (15:47 +0000)
commit6ad6a0084a73088fc2a27ab9958e5c46d6e094fc
tree0814a24146eadf7a3c234c5139cb78c9d35d79cb
parentd9df762b4c62b74f6d3a1521642ea86c26793a22
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'.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/systemd.bbclass