1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmdbusd: Add SIGUSR2 to dump flight recorder

This commit is contained in:
Tony Asleson 2022-08-09 17:44:10 -05:00
parent 05f7fa5a85
commit b3d8366ff2
2 changed files with 5 additions and 0 deletions

View File

@ -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!")

View File

@ -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)