]> 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:09:41 +0000 (15:09 -0400)
committerMichael R Sweet <msweet@msweet.org>
Fri, 14 Jun 2024 19:09:41 +0000 (15:09 -0400)
scheduler/conf.c
scheduler/main.c

index d5e0792f2c6a7fb81fa796b7f8c6b71b669836c6..c1644d324ecb005b7566b08dece447bd0734b080 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 89cd85ca16907c380636df991132da2ec2d9afc7..7cbdc3cc3f2edc25a6be273825540d1cc47d110e 100644 (file)
@@ -1970,6 +1970,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);
+  }
 }