diff options
author | Devaev Maxim <[email protected]> | 2020-12-02 15:07:08 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-12-02 15:07:08 +0300 |
commit | 5bc868662a7ef2b8959a04e6678c512797ebd7be (patch) | |
tree | 102f25b53359e58a8cd42c78a5ea7f57c91f294f /kvmd/aioproc.py | |
parent | 2b064a3bee87a13930e1212b583278ff2a8117db (diff) |
stop signals propagation in 3.9
Diffstat (limited to 'kvmd/aioproc.py')
-rw-r--r-- | kvmd/aioproc.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/kvmd/aioproc.py b/kvmd/aioproc.py index ecf6230e..b4b84ea4 100644 --- a/kvmd/aioproc.py +++ b/kvmd/aioproc.py @@ -20,9 +20,9 @@ # ========================================================================== # +import os import asyncio import asyncio.subprocess -import signal import logging from typing import Tuple @@ -37,7 +37,7 @@ async def run_process(cmd: List[str], err_to_null: bool=False) -> asyncio.subpro *cmd, stdout=asyncio.subprocess.PIPE, stderr=(asyncio.subprocess.DEVNULL if err_to_null else asyncio.subprocess.STDOUT), - preexec_fn=ignore_sigint, + preexec_fn=os.setpgrp, )) @@ -69,9 +69,5 @@ async def log_stdout_infinite(proc: asyncio.subprocess.Process, logger: logging. raise RuntimeError("asyncio process: too many empty lines") -def ignore_sigint() -> None: - signal.signal(signal.SIGINT, signal.SIG_IGN) - - def rename_process(suffix: str, prefix: str="kvmd") -> None: setproctitle.setproctitle(f"{prefix}/{suffix}: {setproctitle.getproctitle()}") |