Skip to content

Commit 00978d9

Browse files
committed
Merge !1765: manager: check that supervisord is manager's parent process
2 parents d34178e + 913bc3f commit 00978d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/knot_resolver/controller/supervisord/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import logging
2-
from os import kill # pylint: disable=[no-name-in-module]
2+
from os import kill, getppid # pylint: disable=[no-name-in-module]
33
from pathlib import Path
44
from typing import Any, Dict, Iterable, NoReturn, Optional, Union, cast
55
from xmlrpc.client import Fault, ServerProxy
@@ -112,7 +112,7 @@ async def _is_supervisord_running(config: KresConfig) -> bool:
112112
pid = await _get_supervisord_pid(config)
113113
if pid is None:
114114
return False
115-
if not _is_process_runinng(pid):
115+
if not _is_process_runinng(pid) or getppid() != pid:
116116
supervisord_pid_file(config).unlink()
117117
return False
118118
return True

0 commit comments

Comments
 (0)