]> code.ossystems Code Review - openembedded-core.git/commitdiff
tcf-agent: Fix daemon termination
authorJan Kiszka <jan.kiszka@web.de>
Tue, 14 Nov 2017 19:56:19 +0000 (20:56 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Nov 2017 14:42:59 +0000 (14:42 +0000)
The upstream init script uses SIGUSR2 to terminate that daemon because
SIGTERM is ignored. As the killproc function does not support specifying
a signal, switch to start-stop-daemon. Drop the retry loop because
SIGUSR2 is lethal for agent.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init

index 6303280aae1d0230a0000c0bdb4c3e89ee8b2a48..f90208555b9f7b66d4bb52e8f73cb2f8a7a61dc6 100755 (executable)
@@ -33,16 +33,7 @@ case "$1" in
 
     stop)
         echo -n "Stopping $DAEMON_NAME: "
-        count=0
-        while [ -n "`/bin/pidof $DAEMON_PATH`" -a $count -lt 10 ] ; do
-            killproc $DAEMON_PATH >& /dev/null
-            sleep 1
-            RETVAL=$?
-            if [ $RETVAL != 0 -o -n "`/bin/pidof $DAEMON_PATH`" ] ; then
-                sleep 3
-            fi
-            count=`expr $count + 1`
-        done
+        start-stop-daemon -K -q -x $DAEMON_PATH -s USR2
         rm -f /var/lock/subsys/$DAEMON_NAME
         if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then
             echo "FAIL"
@@ -72,4 +63,3 @@ case "$1" in
 esac
 
 exit $RETVAL
-