From f2e6cf3ae0f4622bea9364d75dc205728a553e5b Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 8 Dec 2023 09:37:08 +0100 Subject: [PATCH] Respect RUNTIME_DIRECTORY as a default for socket-dir This was lost with the conversion to the new settings. --- pdns/recursordist/rec-main.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index 0e64433b66..5a6f715922 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -2941,6 +2941,13 @@ static void handleRuntimeDefaults(Logr::log_t log) ::arg().set("server-id") = myHostname.has_value() ? *myHostname : ""; } + if (::arg()["socket-dir"].empty()) { + auto* runtimeDir = getenv("RUNTIME_DIRECTORY"); // NOLINT(concurrency-mt-unsafe,cppcoreguidelines-pro-type-vararg) + if (runtimeDir != nullptr) { + ::arg().set("socket-dir") = runtimeDir; + } + } + if (::arg()["socket-dir"].empty()) { if (::arg()["chroot"].empty()) { ::arg().set("socket-dir") = std::string(LOCALSTATEDIR) + "/pdns-recursor"; -- 2.47.2