From 40abe08ac83b2ade00912d53c7f30ab1a0d44979 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Mon, 23 Jul 2018 13:05:39 +0000 Subject: [PATCH] - Fix use-systemd readiness signalling, only when use-systemd is yes and not in signal handler. git-svn-id: file:///svn/unbound/trunk@4797 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/daemon.c | 22 +++++++++------------- doc/Changelog | 4 ++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/daemon/daemon.c b/daemon/daemon.c index e02719f07..a60f4409a 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -182,15 +182,8 @@ static void signal_handling_playback(struct worker* wrk) { #ifdef SIGHUP - if(sig_record_reload) { -# ifdef HAVE_SYSTEMD - sd_notify(0, "RELOADING=1"); -# endif + if(sig_record_reload) worker_sighandler(SIGHUP, wrk); -# ifdef HAVE_SYSTEMD - sd_notify(0, "READY=1"); -# endif - } #endif if(sig_record_quit) worker_sighandler(SIGTERM, wrk); @@ -657,15 +650,18 @@ daemon_fork(struct daemon* daemon) /* Start resolver service on main thread. */ #ifdef HAVE_SYSTEMD - sd_notify(0, "READY=1"); + if(daemon->cfg->use_systemd) + sd_notify(0, "READY=1"); #endif log_info("start of service (%s).", PACKAGE_STRING); worker_work(daemon->workers[0]); #ifdef HAVE_SYSTEMD - if (daemon->workers[0]->need_to_exit) - sd_notify(0, "STOPPING=1"); - else - sd_notify(0, "RELOADING=1"); + if(daemon->cfg->use_systemd) { + if (daemon->workers[0]->need_to_exit) + sd_notify(0, "STOPPING=1"); + else + sd_notify(0, "RELOADING=1"); + } #endif log_info("service stopped (%s).", PACKAGE_STRING); diff --git a/doc/Changelog b/doc/Changelog index fab0b2476..daf94ab03 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +23 July 2018: Wouter + - Fix use-systemd readiness signalling, only when use-systemd is yes + and not in signal handler. + 20 July 2018: Wouter - Fix #4130: print text describing -dd and unbound-checkconf on config file read error at startup, the errors may have been moved