Add additional notifications to Daemon.py
This commit is contained in:
parent
d35e339801
commit
2674f3360c
|
@ -261,6 +261,7 @@ def entrypoint():
|
||||||
|
|
||||||
if "--init-only" in argv:
|
if "--init-only" in argv:
|
||||||
print("Successfully initialized pvcbootstrapd; exiting.")
|
print("Successfully initialized pvcbootstrapd; exiting.")
|
||||||
|
notifications.send_webhook(config, "success", "Successfully initialized pvcbootstrapd")
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
# Start DNSMasq
|
# Start DNSMasq
|
||||||
|
@ -273,12 +274,15 @@ def entrypoint():
|
||||||
|
|
||||||
def term(signum="", frame=""):
|
def term(signum="", frame=""):
|
||||||
print("Received TERM, exiting.")
|
print("Received TERM, exiting.")
|
||||||
|
notifications.send_webhook(config, "begin", "Received TERM, exiting pvcbootstrapd")
|
||||||
cleanup(0)
|
cleanup(0)
|
||||||
|
|
||||||
signal.signal(signal.SIGTERM, term)
|
signal.signal(signal.SIGTERM, term)
|
||||||
signal.signal(signal.SIGINT, term)
|
signal.signal(signal.SIGINT, term)
|
||||||
signal.signal(signal.SIGQUIT, term)
|
signal.signal(signal.SIGQUIT, term)
|
||||||
|
|
||||||
|
notifications.send_webhook(config, "success", "Started up pvcbootstrapd")
|
||||||
|
|
||||||
# Start Flask
|
# Start Flask
|
||||||
pvcbootstrapd.app.run(
|
pvcbootstrapd.app.run(
|
||||||
config["api_address"],
|
config["api_address"],
|
||||||
|
|
Loading…
Reference in New Issue