stop signals propagation in 3.9

This commit is contained in:
Devaev Maxim
2020-12-02 15:07:08 +03:00
parent 2b064a3bee
commit 5bc868662a
6 changed files with 8 additions and 13 deletions

View File

@@ -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()}")