]> 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/7672 policy-loader-improvements 1742/head
authorAleš Mrázek <ales.mrazek@nic.cz>
Thu, 25 Sep 2025 15:16:42 +0000 (17:16 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Tue, 30 Sep 2025 13:14:21 +0000 (15:14 +0200)
daemon/main.c

index 3925a15c18c80b82b0c319d7951a418d6038f40b..79d5fc91327b6742c0dabb2ee2c472fc3786247e 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 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",