]> git.donarmstrong.com Git - unscd.git/blobdiff - debian/patches/notify_systemd_about_successful_startup
Add systemd notification support for startup error reporting
[unscd.git] / debian / patches / notify_systemd_about_successful_startup
diff --git a/debian/patches/notify_systemd_about_successful_startup b/debian/patches/notify_systemd_about_successful_startup
new file mode 100644 (file)
index 0000000..e14cc0d
--- /dev/null
@@ -0,0 +1,30 @@
+From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi@debian.org>
+Date: Thu, 31 May 2018 11:56:10 +0200
+Subject: Notify systemd about successful startup
+
+---
+ nscd.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/nscd.c b/nscd.c
+index 828eb17..4cbd7b1 100644
+--- a/nscd.c
++++ b/nscd.c
+@@ -99,6 +99,8 @@ vda.linux@googlemail.com
+ /* For inet_ntoa (for debug build only) */
+ #include <arpa/inet.h>
++#include <systemd/sd-daemon.h>
++
+ /*
+  * 0.21 add SEGV reporting to worker
+  * 0.22 don't do freeaddrinfo() in GETAI worker, it's crashy
+@@ -2661,6 +2663,8 @@ int main(int argc, char **argv)
+               config.nttl[n] *= 1000;
+       }
++      sd_notify (0, "READY=1");
++
+       main_loop();
+       return 0;