Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] tcf-agent: Fix daemon termination
@ 2017-04-30 15:28 Jan Kiszka
  2017-05-01 16:41 ` Martin Kelly
  0 siblings, 1 reply; 16+ messages in thread
From: Jan Kiszka @ 2017-04-30 15:28 UTC (permalink / raw)
  To: openembedded-core


[-- Attachment #1.1: Type: text/plain, Size: 1407 bytes --]

From: Jan Kiszka <jan.kiszka@siemens.com>

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>
---
 meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
index 6303280aae..bd602c67cb 100755
--- a/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
+++ b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
@@ -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"


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-06-13 17:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-30 15:28 [PATCH] tcf-agent: Fix daemon termination Jan Kiszka
2017-05-01 16:41 ` Martin Kelly
2017-06-01  0:17   ` Martin Kelly
2017-06-01  5:45     ` Martin Kelly
2017-06-06 10:11     ` Jan Kiszka
2017-06-06 17:28       ` Martin Kelly
2017-06-07 16:08         ` Burton, Ross
2017-06-07 16:29           ` Jan Kiszka
2017-06-07 16:33           ` Martin Kelly
2017-06-07 16:34             ` Jan Kiszka
2017-06-07 19:09             ` Burton, Ross
2017-06-13 16:35               ` Martin Kelly
2017-06-13 16:38                 ` Burton, Ross
2017-06-13 16:46                   ` Martin Kelly
2017-06-13 16:52                     ` Burton, Ross
2017-06-13 16:56                       ` Martin Kelly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox