From: Michael R Sweet Date: Fri, 14 Jun 2024 19:09:41 +0000 (-0400) Subject: Don't abort early if there are no listen sockets after loading cupsd.conf (Issue... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7adb50839710f908af11a2f0a7d4b7aa506af2b8;p=thirdparty%2Fcups.git Don't abort early if there are no listen sockets after loading cupsd.conf (Issue #985) --- diff --git a/scheduler/conf.c b/scheduler/conf.c index d5e0792f2c..c1644d324e 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -1048,7 +1048,7 @@ cupsdReadConfiguration(void) * as an error and exit! */ - if (cupsArrayCount(Listeners) == 0) + if (cupsArrayCount(Listeners) == 0 && !OnDemand) { /* * No listeners! diff --git a/scheduler/main.c b/scheduler/main.c index 89cd85ca16..7cbdc3cc3f 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -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); + } }