Only use systemd notify when NOTIFY_SOCKET is set
This commit is contained in:
parent
cd06cc445e
commit
954b3d9b50
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
2
main.py
2
main.py
|
@ -54,7 +54,9 @@ class PodKeeper:
|
||||||
print(f"Starting pod {self.podname} at {last_check}", file=sys.stderr, flush=True)
|
print(f"Starting pod {self.podname} at {last_check}", file=sys.stderr, flush=True)
|
||||||
podman.play.kube(self.podyaml, *self.podnet_args)
|
podman.play.kube(self.podyaml, *self.podnet_args)
|
||||||
try:
|
try:
|
||||||
|
if 'NOTIFY_SOCKET' in os.environ:
|
||||||
sdnotify("--ready")
|
sdnotify("--ready")
|
||||||
|
|
||||||
while not self.stopping.is_set():
|
while not self.stopping.is_set():
|
||||||
self.waiter.wait()
|
self.waiter.wait()
|
||||||
self.waiter.clear()
|
self.waiter.clear()
|
||||||
|
|
Loading…
Reference in a new issue