diff options
author | Devaev Maxim <[email protected]> | 2018-08-20 05:27:19 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-08-20 05:27:19 +0300 |
commit | 0d19451bbe86626eb7bf1b59999ce9316b7dec19 (patch) | |
tree | c553370808861495f337bab24aa17048b170662b | |
parent | 3e3fec4d0cfb6db4579f13b0d10a6b943a1f0111 (diff) |
setproctitle
-rw-r--r-- | kvmd/PKGBUILD | 1 | ||||
-rw-r--r-- | kvmd/kvmd/hid.py | 2 | ||||
-rw-r--r-- | kvmd/kvmd/server.py | 3 | ||||
-rw-r--r-- | kvmd/requirements.txt | 1 | ||||
-rw-r--r-- | kvmd/testenv/requirements.txt | 1 |
5 files changed, 8 insertions, 0 deletions
diff --git a/kvmd/PKGBUILD b/kvmd/PKGBUILD index 2002a92d..6920d207 100644 --- a/kvmd/PKGBUILD +++ b/kvmd/PKGBUILD @@ -17,6 +17,7 @@ depends=( "python-pyudev" "python-raspberry-gpio" "python-pyserial" + "python-setproctitle" ) makedepends=("python-setuptools") source=("$url/archive/v$pkgver.tar.gz") diff --git a/kvmd/kvmd/hid.py b/kvmd/kvmd/hid.py index ee683593..b1d69ad6 100644 --- a/kvmd/kvmd/hid.py +++ b/kvmd/kvmd/hid.py @@ -12,6 +12,7 @@ from typing import NamedTuple import yaml import serial +import setproctitle from .logging import get_logger @@ -130,6 +131,7 @@ class Hid(multiprocessing.Process): get_logger().exception("Can't execute emergency clear HID events") def run(self) -> None: # pylint: disable=too-many-branches + setproctitle.setproctitle("[hid] " + setproctitle.getproctitle()) try: with serial.Serial(self.__device_path, self.__speed) as tty: hid_ready = False diff --git a/kvmd/kvmd/server.py b/kvmd/kvmd/server.py index 6e83059a..a3304dcd 100644 --- a/kvmd/kvmd/server.py +++ b/kvmd/kvmd/server.py @@ -13,6 +13,7 @@ from typing import Callable from typing import Optional import aiohttp.web +import setproctitle from .aioregion import RegionIsBusyError @@ -131,6 +132,8 @@ class Server: # pylint: disable=too-many-instance-attributes def run(self, host: str, port: int) -> None: self.__hid.start() + setproctitle.setproctitle("[main] " + setproctitle.getproctitle()) + app = aiohttp.web.Application(loop=self.__loop) app.router.add_get("/info", self.__info_handler) diff --git a/kvmd/requirements.txt b/kvmd/requirements.txt index 5a2205e0..6ed9b5aa 100644 --- a/kvmd/requirements.txt +++ b/kvmd/requirements.txt @@ -4,3 +4,4 @@ aiofiles pyudev pyyaml pyserial +setproctitle diff --git a/kvmd/testenv/requirements.txt b/kvmd/testenv/requirements.txt index 66450f38..de538a71 100644 --- a/kvmd/testenv/requirements.txt +++ b/kvmd/testenv/requirements.txt @@ -4,5 +4,6 @@ aiofiles pyudev pyyaml pyserial +setproctitle bumpversion tox |