All of lore.kernel.org
 help / color / mirror / Atom feed
* [morty backport][PATCH 0/2] tcf-agent fixes
@ 2017-11-14 19:56 Javier Viguera
  2017-11-14 19:56 ` [morty backport][PATCH 1/2] tcf-agent: kill with USR2 in systemd stop Javier Viguera
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Javier Viguera @ 2017-11-14 19:56 UTC (permalink / raw)
  To: openembedded-core

Hi all,

There are a couple of commits in master fixing the tcf-agent bootscript and systemd service files so the daemon is properly kill on reboot/shutdown.

These patches backport the fixes to Morty.

Regards,

Javier Viguera



--
Jan Kiszka (1):
  tcf-agent: Fix daemon termination

Martin Kelly (1):
  tcf-agent: kill with USR2 in systemd stop

 meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init    | 12 +-----------
 meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service |  2 ++
 2 files changed, 3 insertions(+), 11 deletions(-)



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

* [morty backport][PATCH 1/2] tcf-agent: kill with USR2 in systemd stop
  2017-11-14 19:56 [morty backport][PATCH 0/2] tcf-agent fixes Javier Viguera
@ 2017-11-14 19:56 ` Javier Viguera
  2017-11-15 20:37   ` Otavio Salvador
  2017-11-14 19:56 ` [morty backport][PATCH 2/2] tcf-agent: Fix daemon termination Javier Viguera
  2017-11-15 17:29 ` [morty backport][PATCH 0/2] tcf-agent fixes Martin Kelly
  2 siblings, 1 reply; 6+ messages in thread
From: Javier Viguera @ 2017-11-14 19:56 UTC (permalink / raw)
  To: openembedded-core

From: Martin Kelly <mkelly@xevo.com>

tcf-agent ignores SIGTERM, so upstream uses USR2 instead. This issue was noticed
by Jan Kiszka and Brian Avery around the same time:

https://patchwork.openembedded.org/patch/139546/
https://patchwork.openembedded.org/patch/139560/

However, these patches fixed only the init scripts, not the systemd service
file. This patch fixes the systemd file.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
---
 meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
index fd9a6c4d565b..a486ac7bad63 100644
--- a/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
+++ b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
@@ -5,6 +5,8 @@ After=network.target
 [Service]
 Type=forking
 ExecStart=@SBINDIR@/tcf-agent -d -L- -l0
+KillSignal=USR2
+SuccessExitStatus=USR2
 
 [Install]
 WantedBy=multi-user.target


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

* [morty backport][PATCH 2/2] tcf-agent: Fix daemon termination
  2017-11-14 19:56 [morty backport][PATCH 0/2] tcf-agent fixes Javier Viguera
  2017-11-14 19:56 ` [morty backport][PATCH 1/2] tcf-agent: kill with USR2 in systemd stop Javier Viguera
@ 2017-11-14 19:56 ` Javier Viguera
  2017-11-15 17:29 ` [morty backport][PATCH 0/2] tcf-agent fixes Martin Kelly
  2 siblings, 0 replies; 6+ messages in thread
From: Javier Viguera @ 2017-11-14 19:56 UTC (permalink / raw)
  To: openembedded-core

From: Jan Kiszka <jan.kiszka@web.de>

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>
---
 meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init | 12 +-----------
 1 file changed, 1 insertion(+), 11 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 6303280aae1d..f90208555b9f 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"
@@ -72,4 +63,3 @@ case "$1" in
 esac
 
 exit $RETVAL
-


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

* Re: [morty backport][PATCH 0/2] tcf-agent fixes
  2017-11-14 19:56 [morty backport][PATCH 0/2] tcf-agent fixes Javier Viguera
  2017-11-14 19:56 ` [morty backport][PATCH 1/2] tcf-agent: kill with USR2 in systemd stop Javier Viguera
  2017-11-14 19:56 ` [morty backport][PATCH 2/2] tcf-agent: Fix daemon termination Javier Viguera
@ 2017-11-15 17:29 ` Martin Kelly
  2 siblings, 0 replies; 6+ messages in thread
From: Martin Kelly @ 2017-11-15 17:29 UTC (permalink / raw)
  To: Javier Viguera, openembedded-core

I'm not a maintainer, but both of these look good to me, thanks!

On 11/14/2017 11:56 AM, Javier Viguera wrote:
> Hi all,
> 
> There are a couple of commits in master fixing the tcf-agent bootscript and systemd service files so the daemon is properly kill on reboot/shutdown.
> 
> These patches backport the fixes to Morty.
> 
> Regards,
> 
> Javier Viguera
> 
> 
> 
> --
> Jan Kiszka (1):
>    tcf-agent: Fix daemon termination
> 
> Martin Kelly (1):
>    tcf-agent: kill with USR2 in systemd stop
> 
>   meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init    | 12 +-----------
>   meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service |  2 ++
>   2 files changed, 3 insertions(+), 11 deletions(-)
> 


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

* Re: [morty backport][PATCH 1/2] tcf-agent: kill with USR2 in systemd stop
  2017-11-14 19:56 ` [morty backport][PATCH 1/2] tcf-agent: kill with USR2 in systemd stop Javier Viguera
@ 2017-11-15 20:37   ` Otavio Salvador
  2017-11-15 23:34     ` akuster808
  0 siblings, 1 reply; 6+ messages in thread
From: Otavio Salvador @ 2017-11-15 20:37 UTC (permalink / raw)
  To: Javier Viguera; +Cc: Patches and discussions about the oe-core layer

On Tue, Nov 14, 2017 at 5:56 PM, Javier Viguera <javier.viguera@digi.com> wrote:
> From: Martin Kelly <mkelly@xevo.com>
>
> tcf-agent ignores SIGTERM, so upstream uses USR2 instead. This issue was noticed
> by Jan Kiszka and Brian Avery around the same time:
>
> https://patchwork.openembedded.org/patch/139546/
> https://patchwork.openembedded.org/patch/139560/
>
> However, these patches fixed only the init scripts, not the systemd service
> file. This patch fixes the systemd file.
>
> Signed-off-by: Martin Kelly <mkelly@xevo.com>
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> Signed-off-by: Javier Viguera <javier.viguera@digi.com>


Acked-by: Otavio Salvador <otavio@ossystems.com.br>

Please also queue this for rocko backport. It seems a good fix.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


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

* Re: [morty backport][PATCH 1/2] tcf-agent: kill with USR2 in systemd stop
  2017-11-15 20:37   ` Otavio Salvador
@ 2017-11-15 23:34     ` akuster808
  0 siblings, 0 replies; 6+ messages in thread
From: akuster808 @ 2017-11-15 23:34 UTC (permalink / raw)
  To: Otavio Salvador, Javier Viguera
  Cc: Patches and discussions about the oe-core layer



On 11/15/2017 12:37 PM, Otavio Salvador wrote:
> On Tue, Nov 14, 2017 at 5:56 PM, Javier Viguera <javier.viguera@digi.com> wrote:
>> From: Martin Kelly <mkelly@xevo.com>
>>
>> tcf-agent ignores SIGTERM, so upstream uses USR2 instead. This issue was noticed
>> by Jan Kiszka and Brian Avery around the same time:
>>
>> https://patchwork.openembedded.org/patch/139546/
>> https://patchwork.openembedded.org/patch/139560/
>>
>> However, these patches fixed only the init scripts, not the systemd service
>> file. This patch fixes the systemd file.
>>
>> Signed-off-by: Martin Kelly <mkelly@xevo.com>
>> Signed-off-by: Ross Burton <ross.burton@intel.com>
>> Signed-off-by: Javier Viguera <javier.viguera@digi.com>
>
> Acked-by: Otavio Salvador <otavio@ossystems.com.br>
>
> Please also queue this for rocko backport. It seems a good fix.
rocko released with this fix.
http://cgit.openembedded.org/openembedded-core/commit/meta/recipes-devtools/tcf-agent?h=rocko&id=4f8ed1b3bf676a58055ebe01184b3594459a4118




>



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

end of thread, other threads:[~2017-11-15 23:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14 19:56 [morty backport][PATCH 0/2] tcf-agent fixes Javier Viguera
2017-11-14 19:56 ` [morty backport][PATCH 1/2] tcf-agent: kill with USR2 in systemd stop Javier Viguera
2017-11-15 20:37   ` Otavio Salvador
2017-11-15 23:34     ` akuster808
2017-11-14 19:56 ` [morty backport][PATCH 2/2] tcf-agent: Fix daemon termination Javier Viguera
2017-11-15 17:29 ` [morty backport][PATCH 0/2] tcf-agent fixes Martin Kelly

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.