Bugzilla – Bug 4156
daemon/daemon.c: Fix systemd service manager state change notification
Last modified: 2018-09-17 14:31:19 CEST
Created attachment 525 [details] 0001-daemon-daemon.c-Fix-systemd-service-manager-state-ch.patch Unbound release 1.8.0 introduced a bug in the upstream commit "Fix use-systemd readiness signalling, only when use-systemd is yes and not in signal handler" which only performs service manager state change notification when "use-systemd: yes" is set, which controls whether systemd socket activation is used, according to the unbound.conf manpage. On Debian, since we use [Service] Type=notify in the unbound.service unit, this causes unbound starts/restarts to hang and timeout under 1.8.0, because "use-systemd: yes" (i.e., socket activation) is not enabled, and unbound then fails to send the state change notification. When unbound is compiled with systemd support, it should always sd_notify() regardless of any settings in unbound.conf, because the process startup type is controlled by the service unit, not by the unbound.conf file, and sd_notify()'ing when not running under a Type=notify service unit is harmless. This commit restores the previous behavior which was introduced by Vincent Bernat in the fix for Debian bug #892914 [0] and applied to upstream unbound in [1]. [0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892914 [1] https://www.nlnetlabs.nl/bugs-script/show_bug.cgi?id=4108
Hi Robert, Thank you for the patch. I did not know this is how that worked, but changed the code after people said the previous patch caused crashes, when I introduced similar code in NSD. That I can also fix like this. Best regards, Wouter