Trying to detect systemd service

If the systemd service didn't launch us, then simply loop
forever with a 15 minute sleep in between each loop. This will
make it easier to integrate into Docker, which I'm trying to
make a supported configuration.

I still think running via systemd unit & timer is a better
method, and docker images might actually have systemd inside
depending on the image base? If so, then we'll simply put
a pre-made systemd service and timer unit in the Dockerfile and
then automatically install them upon launch.
This commit is contained in:
A.M. Rowsell 2025-03-05 17:27:01 -05:00
parent 9a5c4616e3
commit 140098507a
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9

View file

@ -210,4 +210,12 @@ def main():
if __name__ == "__main__":
main()
if os.environ["INVOCATION_ID"]:
main()
else:
try:
while True:
main()
time.sleep(15 * 60)
except KeyboardInterrupt:
exit(0)