Wind River Support Network

HomeDefectsLIN8-5989
Fixed

LIN8-5989 : systemd.bbclass: attempting to use SYSTEMD_AUTO_ENABLE_ causes infinit boot

Created: Mar 9, 2017    Updated: Dec 3, 2018
Resolved Date: Mar 17, 2017
Found In Version: 8.0.0.14
Fix Version: 8.0.0.16
Severity: Standard
Applicable for: Wind River Linux 8
Component/s: Userspace

Description

If you create a recipe which has a systemd service file (as the one from below added at the my-test.service file) which you want to have enabled by default in the system the system will spin forever attempting to complete the systemd-postinst.

You would think this would happen for only services which define a "After" to create a chicken before egg situation but this happens with even the simplest service files such as

---
[Unit]
Description=An example service

[Service]
ExecStart=/bin/true

[Install]
WantedBy=multi-user.target
---

When booting you will see something like:
[  *** ] A start job is running for Run pending postinsts (7s / no limit)

Steps to Reproduce

1. Create a recipe which include a service file (such as the one in the description) and has systemd variables set.

inherit systemd

do_install() {
  install -d ${D}${sysconfdir}/systemd/system
  install -m 0755 my-test.service ${D}${sysconfdir}/systemd/system
}

SYSTEMD_PACKAGES += "${PN}"
SYSTEMD_SERVICE_${PN} = "my-test.service"
SYSTEMD_AUTO_ENABLE_${PN} = "enable"

pkg_postinst_${PN}() {
#!/bin/sh -e
if [ x"$D" = "x" ]; then
    # Do something
    echo hanging Hello world at boot
else
    exit 1
fi
}

2. Include the package created from this recipe in your image

3. attempt boot the image

Other Downloads


Live chat
Online