Bug 11795

Summary: [Yocto 2.3.1] Can not stop tcf-agent daemon
Product: [Runtime] General Runtime Reporter: Yi Zhao <yi.zhao>
Component: General RuntimeAssignee: Armin Kuster <akuster>
Status: VERIFIED FIXED QA Contact: Yi Zhao <yi.zhao>
Severity: normal    
Priority: Undecided CC: richard.purdie, sgw, yi.zhao
Version: 2.3.1   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: No (bug/feature does not impact docs)

Description Yi Zhao 2017-07-17 03:26:54 UTC
Git rev: pyro/6bd890d9e011014cf323e61267f8b256949d44aa

This bug is cloned from bug 10858 which already fixed in master branch. It's better to backport the following 2 patches to pyro branch:

commit b467a22729bea886d7bde976c9606ac8e4589cde
Author: Jan Kiszka <jan.kiszka@web.de>
Date:   Sun Apr 30 17:28:01 2017 +0200

    tcf-agent: Fix daemon termination
    
    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.
    
    (From OE-Core rev: 7a47752f8223f3c0ed4354d5e39f1319071acf41)
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Ross Burton <ross.burton@intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

commit b33356d168c0fec9b2df387b51240fa6566ca145
Author: Martin Kelly <mkelly@xevo.com>
Date:   Thu Jun 1 14:43:54 2017 +0900

    tcf-agent: kill with USR2 in systemd stop
    
    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.
    
    (From OE-Core rev: 4f8ed1b3bf676a58055ebe01184b3594459a4118)
    
    Signed-off-by: Martin Kelly <mkelly@xevo.com>
    Signed-off-by: Ross Burton <ross.burton@intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Comment 2 Yi Zhao 2017-09-20 06:37:32 UTC
Verified with 2.3.2 rc1
git rev: pyro/ce26a57e04ad65c02087629701d96448a44e73d5