diff options
Diffstat (limited to 'kvmd/plugins/hid')
-rw-r--r-- | kvmd/plugins/hid/otg/device.py | 8 | ||||
-rw-r--r-- | kvmd/plugins/hid/serial.py | 7 |
2 files changed, 6 insertions, 9 deletions
diff --git a/kvmd/plugins/hid/otg/device.py b/kvmd/plugins/hid/otg/device.py index d1a2c86c..44c286cb 100644 --- a/kvmd/plugins/hid/otg/device.py +++ b/kvmd/plugins/hid/otg/device.py @@ -22,7 +22,6 @@ import os import select -import signal import multiprocessing import multiprocessing.queues import queue @@ -31,11 +30,10 @@ import time from typing import Dict -import setproctitle - from ....logging import get_logger from .... import aiomulti +from .... import aioproc # ===== @@ -78,8 +76,8 @@ class BaseDeviceProcess(multiprocessing.Process): # pylint: disable=too-many-in logger = get_logger(0) logger.info("Started HID-%s pid=%d", self.__name, os.getpid()) - signal.signal(signal.SIGINT, signal.SIG_IGN) - setproctitle.setproctitle(f"kvmd/hid-{self.__name}: {setproctitle.getproctitle()}") + aioproc.ignore_sigint() + aioproc.rename_process(f"hid-{self.__name}") while not self.__stop_event.is_set(): try: diff --git a/kvmd/plugins/hid/serial.py b/kvmd/plugins/hid/serial.py index 0af31eca..6f92d9e4 100644 --- a/kvmd/plugins/hid/serial.py +++ b/kvmd/plugins/hid/serial.py @@ -21,7 +21,6 @@ import os -import signal import asyncio import multiprocessing import multiprocessing.queues @@ -35,7 +34,6 @@ from typing import Dict from typing import AsyncGenerator import serial -import setproctitle from ...logging import get_logger @@ -43,6 +41,7 @@ from ...keyboard.mappings import KEYMAP from ... import aiotools from ... import aiomulti +from ... import aioproc from ... import gpio from ...yamlconf import Option @@ -278,8 +277,8 @@ class Plugin(BaseHid, multiprocessing.Process): # pylint: disable=too-many-inst logger = get_logger(0) logger.info("Started HID pid=%d", os.getpid()) - signal.signal(signal.SIGINT, signal.SIG_IGN) - setproctitle.setproctitle(f"kvmd/hid: {setproctitle.getproctitle()}") + aioproc.ignore_sigint() + aioproc.rename_process("hid") while not self.__stop_event.is_set(): try: |