From: Remi Gacogne Date: Wed, 1 Jun 2022 15:14:14 +0000 (+0200) Subject: dnsdist: Log when exiting due to a SIGTERM signal X-Git-Tag: auth-4.8.0-alpha0~80^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11669%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Log when exiting due to a SIGTERM signal The recursor already does the same, and it might be useful to understand why the process was terminated. --- diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index a4805d03e4..1afb17f012 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -2191,12 +2191,22 @@ static void cleanupLuaObjects() clearWebHandlers(); } -static void sighandler(int sig) +static void sigTermHandler(int) { cleanupLuaObjects(); exit(EXIT_SUCCESS); } -#endif +#else /* COVERAGE */ +static void sigTermHandler(int) +{ + if (g_syslog) { + syslog(LOG_INFO, "Exiting on user request"); + } + std::cout<<"Exiting on user request"<