From: Ross Burton Date: Tue, 9 Apr 2013 15:48:21 +0000 (+0100) Subject: systemd.bbclass: restart service in postinst, not start X-Git-Tag: rev_ivi_2015_02_04~12970 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2ad009d9a7a980d4c4a040944cca5b34662a0ce;p=scm%2Fbb%2Ftizen-distro.git systemd.bbclass: restart service in postinst, not start When upgrading packages it's possible that the service is already running because opkg doesn't actually execute the prerm hooks on upgrades, which is where the service should be stopped. Handle this case by restarting in postinst instead of starting. If the service isn't already running then this doesn't make a difference, but if it is running then the service will be restarted. [ YOCTO #4213 ] (From OE-Core rev: 319ef0df4ae7ed0372eff90e11244123eccb023c) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass index 69eeb9e..8084251 100644 --- a/meta/classes/systemd.bbclass +++ b/meta/classes/systemd.bbclass @@ -31,7 +31,7 @@ if type systemctl >/dev/null 2>/dev/null; then systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE} if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then - systemctl start ${SYSTEMD_SERVICE} + systemctl restart ${SYSTEMD_SERVICE} fi fi }