]> git.donarmstrong.com Git - unscd.git/commitdiff
Add systemd notification support for startup error reporting
authorFerenc Wágner <wferi@debian.org>
Thu, 31 May 2018 10:06:35 +0000 (12:06 +0200)
committerFerenc Wágner <wferi@debian.org>
Thu, 31 May 2018 10:52:36 +0000 (12:52 +0200)
debian/changelog
debian/control
debian/patches/notify_systemd_about_successful_startup [new file with mode: 0644]
debian/patches/series
debian/rules
debian/unscd.service

index 85878697310401868c4e74da6f8ee6f9de45c3c6..62b6275f120e71e3eb9fe23cf5506b5d9e0e3501 100644 (file)
@@ -1,3 +1,10 @@
+unscd (0.53-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add systemd notification support for startup error reporting.
+
+ -- Ferenc Wágner <wferi@debian.org>  Thu, 31 May 2018 12:03:28 +0200
+
 unscd (0.53-1) unstable; urgency=medium
 
   * New upstream revision
index 0bb9bb5d545756586c0cde3d75e0b099f6c01f84..8842ae1836085100d9d0c6f055e9c3e44655018d 100644 (file)
@@ -2,7 +2,8 @@ Source: unscd
 Section: admin
 Priority: optional
 Standards-Version: 4.1.4
-Build-Depends: debhelper (>= 10), groff-base, help2man
+Build-Depends: debhelper (>= 10), groff-base, help2man,
+ libsystemd-dev
 Maintainer: Don Armstrong <don@debian.org>
 Vcs-Browser: https://git.donarmstrong.com/unscd.git
 Vcs-Git: https://git.donarmstrong.com/unscd.git
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;
index 9689a285b2c110155828534f58ca0b059e4b1277..f3702ee8f3aa5c6229ccb3f3e0f3424641669e34 100644 (file)
@@ -1,3 +1,4 @@
 change_invalidate_request_info_output
 support_large_numbers_in_config
 no_debug_on_invalidate
+notify_systemd_about_successful_startup
index 413cdd5f2814ca78f056a586ebcb099fc1fa0fd1..e5e2a42358b9aec4a26b346c8a2a7f4828642e63 100755 (executable)
@@ -8,7 +8,7 @@ override_dh_auto_clean:
        dh_auto_clean
 
 override_dh_auto_build:
-       gcc $(CFLAGS) $(LDFLAGS) -o nscd nscd.c
+       gcc $(CFLAGS) $(LDFLAGS) -o nscd nscd.c -lsystemd
        help2man --name 'nscd which does not hang' \
                --include debian/help2man \
                --no-info \
index fc1f0605258d8c9993abdd39487ea8f731c96fa6..752c8e2cce825e1282955becd1705a3d81764268 100644 (file)
@@ -4,6 +4,7 @@ Description=Name Service Cache Daemon
 [Service]
 User=root
 ExecStart=/usr/sbin/nscd -d
+Type=notify
 Restart=always
 
 [Install]