Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 5656e6e

Browse files
committed
[client] Avoid system hook kill if not in the context of a connector (#295)
1 parent 59ac9bf commit 5656e6e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pycti/connector/opencti_connector_helper.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@
3333

3434
def killProgramHook(etype, value, tb):
3535
traceback.print_exception(etype, value, tb)
36-
os.kill(os.getpid(), signal.SIGKILL)
37-
38-
39-
sys.excepthook = killProgramHook
36+
os.kill(os.getpid(), signal.SIGTERM)
4037

4138

4239
def run_loop(loop):
@@ -478,6 +475,8 @@ class OpenCTIConnectorHelper: # pylint: disable=too-many-public-methods
478475
"""
479476

480477
def __init__(self, config: Dict) -> None:
478+
sys.excepthook = killProgramHook
479+
481480
# Load API config
482481
self.opencti_url = get_config_variable(
483482
"OPENCTI_URL", ["opencti", "url"], config

0 commit comments

Comments
 (0)