- Fix #59, when compiled with systemd support check that we can properly

communicate with systemd through the `NOTIFY_SOCKET`.
This commit is contained in:
George Thessalonikefs 2019-08-14 15:51:28 +02:00
parent b266db3920
commit a90f173875
2 changed files with 11 additions and 1 deletions

View file

@ -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]);

View file

@ -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.