diff options
author | Stefano Babic <sbabic@denx.de> | 2019-06-18 12:06:17 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-06-19 12:46:43 +0100 |
commit | ffdd54954b40881f73a600cf941dfc38c428d9f0 (patch) | |
tree | 87f7b3c0b39a2253ec006fd1bef867ac52eb8954 /meta/recipes-extended | |
parent | f25d8604ea3165f8789e1565a67193cfa28ed888 (diff) | |
download | poky-ffdd54954b40881f73a600cf941dfc38c428d9f0.tar.gz |
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.
(From OE-Core rev: 24ccfd80edb74871d0d69ddbe83c358f04ac0844)
Signed-off-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r-- | meta/recipes-extended/sysstat/sysstat.inc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/meta/recipes-extended/sysstat/sysstat.inc b/meta/recipes-extended/sysstat/sysstat.inc index 6b21c6b8c1..4e29721666 100644 --- a/meta/recipes-extended/sysstat/sysstat.inc +++ b/meta/recipes-extended/sysstat/sysstat.inc | |||
@@ -52,12 +52,11 @@ do_install() { | |||
52 | } | 52 | } |
53 | 53 | ||
54 | pkg_postinst_${PN} () { | 54 | pkg_postinst_${PN} () { |
55 | if [ -n "$D" ]; then | 55 | if [ ! -n "$D" ]; then |
56 | exit 0 | 56 | if [ -e /etc/init.d/populate-volatile.sh ]; then |
57 | fi | 57 | /etc/init.d/populate-volatile.sh update |
58 | if [ -e /etc/init.d/populate-volatile.sh ]; then | 58 | fi |
59 | /etc/init.d/populate-volatile.sh update | 59 | fi |
60 | fi | ||
61 | } | 60 | } |
62 | 61 | ||
63 | FILES_${PN} += "${libdir}/sa ${systemd_system_unitdir}" | 62 | FILES_${PN} += "${libdir}/sa ${systemd_system_unitdir}" |