Add additional notifications to Daemon.py

This commit is contained in:
Joshua Boniface 2022-07-06 17:49:24 +00:00
parent d35e339801
commit 2674f3360c
1 changed files with 4 additions and 0 deletions

View File

@ -261,6 +261,7 @@ def entrypoint():
if "--init-only" in argv:
print("Successfully initialized pvcbootstrapd; exiting.")
notifications.send_webhook(config, "success", "Successfully initialized pvcbootstrapd")
exit(0)
# Start DNSMasq
@ -273,12 +274,15 @@ def entrypoint():
def term(signum="", frame=""):
print("Received TERM, exiting.")
notifications.send_webhook(config, "begin", "Received TERM, exiting pvcbootstrapd")
cleanup(0)
signal.signal(signal.SIGTERM, term)
signal.signal(signal.SIGINT, term)
signal.signal(signal.SIGQUIT, term)
notifications.send_webhook(config, "success", "Started up pvcbootstrapd")
# Start Flask
pvcbootstrapd.app.run(
config["api_address"],