]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Don't abort early if there are no listen sockets after loading cupsd.conf (Issue...
authorMichael R Sweet <msweet@msweet.org>
Fri, 14 Jun 2024 19:10:21 +0000 (15:10 -0400)
committerMichael R Sweet <msweet@msweet.org>
Fri, 14 Jun 2024 19:10:21 +0000 (15:10 -0400)
scheduler/conf.c
scheduler/main.c

index ebf8ca8ccdad669b09d5a609c46f975d9ea87f9a..34b30e56d14f62d46cad0c32be24c55525a3397c 100644 (file)
@@ -1048,7 +1048,7 @@ cupsdReadConfiguration(void)
   * as an error and exit!
   */
 
-  if (cupsArrayCount(Listeners) == 0)
+  if (cupsArrayCount(Listeners) == 0 && !OnDemand)
   {
    /*
     * No listeners!
index 4472863081848eb5f3ec816e2ae95a0af66e8811..70f3159df676fcb6d20f87dd97f31b50332b6551 100644 (file)
@@ -2036,6 +2036,23 @@ service_checkin(void)
     service_add_listener(fd, 0);
   }
 #endif /* HAVE_LAUNCHD */
+
+  if (cupsArrayCount(Listeners) == 0)
+  {
+   /*
+    * No listeners!
+    */
+
+    cupsdLogMessage(CUPSD_LOG_EMERG,
+                    "No valid Listen or Port lines were found in the "
+                   "configuration file.");
+
+   /*
+    * Commit suicide...
+    */
+
+    cupsdEndProcess(getpid(), 0);
+  }
 }