From 2834f416c07f9d380b3fc20757e185b46306dfc0 Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Wed, 18 Nov 2020 23:41:14 +0100 Subject: [PATCH] Tell status to systemd-notify --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index e4f01af..168e723 100644 --- a/main.py +++ b/main.py @@ -57,7 +57,7 @@ class PodKeeper: podman.play.kube(self.podyaml, *self.podnet_args) try: if 'NOTIFY_SOCKET' in os.environ: - sdnotify("--ready") + sdnotify("--ready", f"--pid={os.getpid()}", "--status=\"Monitoring pod...\"") while not self.stopping.is_set(): self.waiter.wait() @@ -71,6 +71,8 @@ class PodKeeper: self.reloading.clear() self.reload_pod() + if 'NOTIFY_SOCKET' in os.environ: + sdnotify("--status=\"Stopping pod\"") finally: self.stop_pod()