summaryrefslogtreecommitdiff
path: root/src/services/vyos-http-api-server
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-05-23 07:33:47 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-06-25 10:57:58 +0100
commitd9fbad6a6bbba292f31fe50e57af893062c7a584 (patch)
tree3c6b5d14d2062f1ef043d18db1932d22b5c7b0e7 /src/services/vyos-http-api-server
parentd41708ee247ce5efc5dc06f2d233e8d620fc6e4a (diff)
downloadvyos-1x-d9fbad6a6bbba292f31fe50e57af893062c7a584.tar.gz
vyos-1x-d9fbad6a6bbba292f31fe50e57af893062c7a584.zip
systemd: T2494: use Type=notify with daemon
Notify systemd via the notify API when the python daemon are ready to take connection https://github.com/torfsen/python-systemd-tutorial
Diffstat (limited to 'src/services/vyos-http-api-server')
-rwxr-xr-xsrc/services/vyos-http-api-server2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/services/vyos-http-api-server b/src/services/vyos-http-api-server
index b256add98..38bf2f8ce 100755
--- a/src/services/vyos-http-api-server
+++ b/src/services/vyos-http-api-server
@@ -28,6 +28,7 @@ import vyos.config
from flask import Flask, request
from waitress import serve
+import systemd.daemon
from functools import wraps
@@ -396,6 +397,7 @@ if __name__ == '__main__':
signal.signal(signal.SIGTERM, sig_handler)
+ systemd.daemon.notify('READY=1')
try:
serve(app, host=server_config["listen_address"],
port=server_config["port"])