From: Michael Tremer Date: Sun, 29 Jan 2023 21:18:53 +0000 (+0000) Subject: networkd: Tell systemd about the daemon status X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26acbb4e03e3a44e6046884eab25f6c7e376c105;p=network.git networkd: Tell systemd about the daemon status Signed-off-by: Michael Tremer --- diff --git a/src/networkd/main.c b/src/networkd/main.c index 14aafdd3..2429ff5e 100644 --- a/src/networkd/main.c +++ b/src/networkd/main.c @@ -18,6 +18,28 @@ # # #############################################################################*/ +#include +#include + +#include +#include + int main(int argc, char** argv) { - return 0; + // XXX Drop privileges + + // We are now ready to process any requests + sd_notify(0, "READY=1\n" "STATUS=Processing requests..."); + + // Run event loop + // XXX TODO + + // Let systemd know that we are shutting down + sd_notify(0, "STOPPING=1\n" "STATUS=Shutting down..."); + + return EXIT_SUCCESS; + +ERROR: + sd_notifyf(0, "ERRNO=%i", errno); + + return EXIT_FAILURE; }