Skip to content

Commit 6131f6a

Browse files
committed
Don't abort early if there are no listen sockets after loading cupsd.conf (Issue #985)
1 parent deb86eb commit 6131f6a

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

scheduler/conf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ cupsdReadConfiguration(void)
10481048
* as an error and exit!
10491049
*/
10501050

1051-
if (cupsArrayCount(Listeners) == 0)
1051+
if (cupsArrayCount(Listeners) == 0 && !OnDemand)
10521052
{
10531053
/*
10541054
* No listeners!

scheduler/main.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,6 +2036,23 @@ service_checkin(void)
20362036
service_add_listener(fd, 0);
20372037
}
20382038
#endif /* HAVE_LAUNCHD */
2039+
2040+
if (cupsArrayCount(Listeners) == 0)
2041+
{
2042+
/*
2043+
* No listeners!
2044+
*/
2045+
2046+
cupsdLogMessage(CUPSD_LOG_EMERG,
2047+
"No valid Listen or Port lines were found in the "
2048+
"configuration file.");
2049+
2050+
/*
2051+
* Commit suicide...
2052+
*/
2053+
2054+
cupsdEndProcess(getpid(), 0);
2055+
}
20392056
}
20402057

20412058

0 commit comments

Comments
 (0)