add 'signals-ignore' option (#2296)
This commit is contained in:
@@ -3308,6 +3308,18 @@ Description
|
||||
this cache.
|
||||
|
||||
|
||||
signals-ignore
|
||||
--------------
|
||||
Type
|
||||
``list`` of ``strings``
|
||||
Example
|
||||
``["SIGTTOU", "SIGTTIN", "SIGTERM"]``
|
||||
Description
|
||||
The list of signal names to ignore, i.e. set
|
||||
`SIG_IGN <https://docs.python.org/3/library/signal.html#signal.SIG_IGN>`_
|
||||
as signal handler for.
|
||||
|
||||
|
||||
pyopenssl
|
||||
---------
|
||||
Type
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2014-2021 Mike Fährmann
|
||||
# Copyright 2014-2022 Mike Fährmann
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
@@ -131,6 +131,19 @@ def main():
|
||||
for opts in args.options:
|
||||
config.set(*opts)
|
||||
|
||||
# signals
|
||||
signals = config.get((), "signals-ignore")
|
||||
if signals:
|
||||
import signal
|
||||
if isinstance(signals, str):
|
||||
signals = signals.split(",")
|
||||
for signal_name in signals:
|
||||
signal_num = getattr(signal, signal_name, None)
|
||||
if signal_num is None:
|
||||
log.warning("signal '%s' is not defined", signal_name)
|
||||
else:
|
||||
signal.signal(signal_num, signal.SIG_IGN)
|
||||
|
||||
# extractor modules
|
||||
modules = config.get(("extractor",), "modules")
|
||||
if modules is not None:
|
||||
|
||||
Reference in New Issue
Block a user