From 3449d74b4eb13019246ab507029fee3bc78a2ff9 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 13 Mar 2020 17:28:08 +0000 Subject: [PATCH] Fix stop command by using default SIGTERM handler in children The daemon child processes do not respond to a SIGTERM. This means that they stay running indefinitely. This is because the manager process installs a SIGTERM handler to propagate the signal to children, and this handler is inherited by the children. Return children to the default handler for SIGTERM. Change-Id: I784e7cd9e0545a591150dc21a8232bd85672c21c Story: 2003534 Task: 24819 --- virtualbmc/manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/virtualbmc/manager.py b/virtualbmc/manager.py index 5edc7d9..221b22a 100644 --- a/virtualbmc/manager.py +++ b/virtualbmc/manager.py @@ -15,6 +15,7 @@ import errno import multiprocessing import os import shutil +import signal from virtualbmc import config as vbmc_config from virtualbmc import exception @@ -113,6 +114,9 @@ class VirtualBMCManager(object): """ def vbmc_runner(bmc_config): + # The manager process installs a signal handler for SIGTERM to + # propagate it to children. Return to the default handler. + signal.signal(signal.SIGTERM, signal.SIG_DFL) show_passwords = CONF['default']['show_passwords']