From: George Thessalonikefs Date: Wed, 14 Aug 2019 13:51:28 +0000 (+0200) Subject: - Fix #59, when compiled with systemd support check that we can properly X-Git-Tag: release-1.9.3rc1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a90f173875baf9a40ec2f2860439f571c2f3e280;p=thirdparty%2Funbound.git - Fix #59, when compiled with systemd support check that we can properly communicate with systemd through the `NOTIFY_SOCKET`. --- diff --git a/daemon/daemon.c b/daemon/daemon.c index 7461a26e2..3219d3095 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -575,6 +575,7 @@ void daemon_fork(struct daemon* daemon) { int have_view_respip_cfg = 0; + int ret; log_assert(daemon); if(!(daemon->views = views_create())) @@ -660,7 +661,12 @@ daemon_fork(struct daemon* daemon) /* Start resolver service on main thread. */ #ifdef HAVE_SYSTEMD - sd_notify(0, "READY=1"); + ret = sd_notify(0, "READY=1"); + if(ret <= 0 && getenv("NOTIFY_SOCKET")) + fatal_exit("sd_notify failed %s: %s. Make sure that unbound has " + "access/permission to use the socket presented by systemd.", + getenv("NOTIFY_SOCKET"), + (ret==0?"no $NOTIFY_SOCKET": strerror(-ret))); #endif log_info("start of service (%s).", PACKAGE_STRING); worker_work(daemon->workers[0]); diff --git a/doc/Changelog b/doc/Changelog index 3b6ed46f7..36909725a 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +14 August 2019: George + - Fix #59, when compiled with systemd support check that we can properly + communicate with systemd through the `NOTIFY_SOCKET`. + 14 August 2019: Wouter - Generate configlexer with newer flex.