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
This commit is contained in:
Mark Goddard 2020-03-13 17:28:08 +00:00
parent 4f2aa4540b
commit 3449d74b4e
1 changed files with 4 additions and 0 deletions

View File

@ -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']