]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/main.c: notify_ready: do not fail if NOTIFY_SOCKET is not configured docs-policy-loade-4z1auj/deployments/7768 1742/head
authorAleš Mrázek <ales.mrazek@nic.cz>
Thu, 25 Sep 2025 15:16:42 +0000 (17:16 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 15 Oct 2025 14:18:09 +0000 (16:18 +0200)
daemon/main.c

index 3925a15c18c80b82b0c319d7951a418d6038f40b..b1d76cfd1ef43057a8d65b4f9776527fa90b15ff 100644 (file)
@@ -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 it 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",