]> code.ossystems Code Review - openembedded-core.git/commitdiff
systemd.bbclass: restart service in postinst, not start
authorRoss Burton <ross.burton@intel.com>
Tue, 9 Apr 2013 15:48:21 +0000 (16:48 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 9 Apr 2013 16:02:04 +0000 (17:02 +0100)
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 ]

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/systemd.bbclass

index 69eeb9ef16123a615fe701d3cbca17d0aa49a40d..8084251f1383472316f11afb42262793586add1b 100644 (file)
@@ -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
 }