Wind River Support Network

HomeDefectsLIN7-7878
Fixed

LIN7-7878 : systemd.bbclass: attempting to use SYSTEMD_AUTO_ENABLE_ causes infinit boot

Created: Apr 6, 2017    Updated: Sep 8, 2018
Resolved Date: May 12, 2017
Found In Version: 7.0.0.23
Fix Version: 7.0.0.25
Severity: Standard
Applicable for: Wind River Linux 7
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