From b3d8366ff21ee69380ab5fbca48204212a64a0cd Mon Sep 17 00:00:00 2001 From: Tony Asleson Date: Tue, 9 Aug 2022 17:44:10 -0500 Subject: [PATCH] lvmdbusd: Add SIGUSR2 to dump flight recorder --- daemons/lvmdbusd/main.py | 1 + daemons/lvmdbusd/utils.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/daemons/lvmdbusd/main.py b/daemons/lvmdbusd/main.py index 7b455052e..5e6f72cdc 100644 --- a/daemons/lvmdbusd/main.py +++ b/daemons/lvmdbusd/main.py @@ -77,6 +77,7 @@ def install_signal_handlers(): signal_add(GLib.PRIORITY_HIGH, signal.SIGHUP, utils.handler, signal.SIGHUP) signal_add(GLib.PRIORITY_HIGH, signal.SIGINT, utils.handler, signal.SIGINT) signal_add(GLib.PRIORITY_HIGH, signal.SIGUSR1, utils.handler, signal.SIGUSR1) + signal_add(GLib.PRIORITY_HIGH, signal.SIGUSR2, utils.handler, signal.SIGUSR2) else: log_error("GLib.unix_signal_[add|add_full] are NOT available!") diff --git a/daemons/lvmdbusd/utils.py b/daemons/lvmdbusd/utils.py index d24a34935..a10fa7864 100644 --- a/daemons/lvmdbusd/utils.py +++ b/daemons/lvmdbusd/utils.py @@ -346,8 +346,12 @@ def dump_threads_stackframe(): # noinspection PyUnusedLocal def handler(signum): try: + # signal 10 if signum == signal.SIGUSR1: dump_threads_stackframe() + # signal 12 + elif signum == signal.SIGUSR2: + cfg.blackbox.dump() else: cfg.run.value = 0 log_debug('Exiting daemon with signal %d' % signum) -- 2.43.5