From: Aleš Mrázek Date: Thu, 25 Sep 2025 15:16:42 +0000 (+0200) Subject: daemon/main.c: notify_ready: do not fail if NOTIFY_SOCKET is not configured X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fpolicy-loader-improvements;p=thirdparty%2Fknot-resolver.git daemon/main.c: notify_ready: do not fail if NOTIFY_SOCKET is not configured --- diff --git a/daemon/main.c b/daemon/main.c index 3925a15c1..79d5fc913 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -394,9 +394,14 @@ static int notify_ready(const char *state) int sockfd; struct sockaddr_un addr; char *socket_path = getenv("NOTIFY_SOCKET"); + /* If the supervisor does not set $NOTIFY_SOCKET, + * it means that he does not expect a READY notification. */ if (!socket_path) { - kr_log_error(WORKER, "Failed retrieving env variable $NOTIFY_SOCKET\n"); - return EXIT_FAILURE; + kr_log_debug(WORKER, + "skipped the READY notification, " + "$NOTIFY_SOCKET env variable is not configured\n" + ); + return kr_ok(); } if ((sockfd = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) { kr_log_error(WORKER, "Failed to create unix socket at $NOTIFY_SOCKET ('%s'): %s\n",