diff options
author | Maxim Devaev <[email protected]> | 2023-03-07 00:55:55 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-03-07 00:55:55 +0200 |
commit | 9ecb7fb94d629919f71f4fd58e3502f041f1b7d9 (patch) | |
tree | ed6ee5a1a2d29a8043f42f5cbfe6459a80a4cd3e /kvmd/apps/cleanup/__init__.py | |
parent | 49a1beab37741d53a1c37f2b5c9124788fe0b3f0 (diff) |
don't remove sockets in kvmd.apps.cleanup
Diffstat (limited to 'kvmd/apps/cleanup/__init__.py')
-rw-r--r-- | kvmd/apps/cleanup/__init__.py | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/kvmd/apps/cleanup/__init__.py b/kvmd/apps/cleanup/__init__.py index 5e83bd9a..83a9825e 100644 --- a/kvmd/apps/cleanup/__init__.py +++ b/kvmd/apps/cleanup/__init__.py @@ -20,7 +20,6 @@ # ========================================================================== # -import os import signal import time @@ -56,20 +55,6 @@ def _kill_streamer(config: Section) -> None: logger.exception("Can't send SIGKILL to streamer with pid=%d", proc.pid) -def _remove_sockets(config: Section) -> None: - logger = get_logger(0) - for (owner, unix_path) in [ - ("KVMD", config.server.unix), - ("streamer", config.streamer.unix), - ]: - if unix_path and os.path.exists(unix_path): - logger.info("Removing %s socket %r ...", owner, unix_path) - try: - os.remove(unix_path) - except Exception: # pragma: nocover - logger.exception("Can't remove %s socket %r", owner, unix_path) - - # ===== def main(argv: (list[str] | None)=None) -> None: config = init( @@ -82,13 +67,9 @@ def main(argv: (list[str] | None)=None) -> None: logger = get_logger(0) logger.info("Cleaning up ...") - for func in [ - _kill_streamer, - _remove_sockets, - ]: - try: - func(config) - except Exception: - pass + try: + _kill_streamer(config) + except Exception: + pass logger.info("Bye-bye") |