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>
|
4
main.py
4
main.py
|
@ -54,7 +54,9 @@ class PodKeeper:
|
|||
print(f"Starting pod {self.podname} at {last_check}", file=sys.stderr, flush=True)
|
||||
podman.play.kube(self.podyaml, *self.podnet_args)
|
||||
try:
|
||||
sdnotify("--ready")
|
||||
if 'NOTIFY_SOCKET' in os.environ:
|
||||
sdnotify("--ready")
|
||||
|
||||
while not self.stopping.is_set():
|
||||
self.waiter.wait()
|
||||
self.waiter.clear()
|
||||
|
|
Loading…
Reference in a new issue