From: Zdenek Dohnal Date: Mon, 29 Nov 2021 12:18:18 +0000 (+0100) Subject: Add --with-systemd-timeoutstartsec configure option X-Git-Tag: v2.4.0~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F298%2Fhead;p=thirdparty%2Fcups.git Add --with-systemd-timeoutstartsec configure option cupsd can be killed by systemd if the daemon takes too much time when starting - f.e. when loading many queues and/or not enough memory for loading the daemon quicker. TimeoutStartSec directive for systemd services defines the time after which the daemon is killed - if set to 'infinity', a service is not killed. --- diff --git a/CHANGES.md b/CHANGES.md index c13a2e4886..53ba647f76 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ Changes in CUPS v2.4.0 (TBA) --------------------------- - Added configure option --with-idle-exit-timeout (Issue #294) +- Added --with-systemd-timeoutstartsec configure option (Issue #298) - DigestOptions now are applied for MD5 Digest authentication defined by RFC 2069 as well (Issue #287) - Fixed compilation on Solaris (Issue #293) diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4 index 9420e1510e..d153fbc71e 100644 --- a/config-scripts/cups-defaults.m4 +++ b/config-scripts/cups-defaults.m4 @@ -441,3 +441,18 @@ AC_ARG_WITH([idle_exit_timeout], AS_HELP_STRING([--with-idle-exit-timeout], [set ]) AC_SUBST([EXIT_TIMEOUT]) + +dnl set TimeoutStartSec for cups.service +dnl - if used as --without-*, it sets TimeoutStartSec to infinity +AC_ARG_WITH([systemd-timeoutstartsec], + AS_HELP_STRING([--with-systemd-timeoutstartsec], + [set TimeoutStartSec value in cups.service, default=default value in systemd]), [ + AS_IF([ test "x$withval" = "xno" ], [ + TIMEOUTSTARTSEC="TimeoutStartSec=infinity" + ], [ + TIMEOUTSTARTSEC="TimeoutStartSec=$withval" + ]) +], [ + TIMEOUTSTARTSEC="" +]) +AC_SUBST([TIMEOUTSTARTSEC]) diff --git a/configure b/configure index b8b99938b1..d5b5ca0dfa 100755 --- a/configure +++ b/configure @@ -652,6 +652,7 @@ ac_subst_vars='LTLIBOBJS LIBOBJS UNINSTALL_LANGUAGES INSTALL_LANGUAGES +TIMEOUTSTARTSEC EXIT_TIMEOUT SYSTEMD_WANTED_BY CUPS_WEBIF @@ -941,6 +942,7 @@ with_snmp_community with_ipp_port enable_webif with_idle_exit_timeout +with_systemd_timeoutstartsec ' ac_precious_vars='build_alias host_alias @@ -1670,6 +1672,9 @@ Optional Packages: --with-idle-exit-timeout set the default value for IdleExitTimeout, default=60 + --with-systemd-timeoutstartsec + set TimeoutStartSec value in cups.service, + default=default value in systemd Some influential environment variables: CC C compiler command @@ -12134,6 +12139,30 @@ fi +# Check whether --with-systemd-timeoutstartsec was given. +if test ${with_systemd_timeoutstartsec+y} +then : + withval=$with_systemd_timeoutstartsec; + if test "x$withval" = "xno" +then : + + TIMEOUTSTARTSEC="TimeoutStartSec=infinity" + +else $as_nop + + TIMEOUTSTARTSEC="TimeoutStartSec=$withval" + +fi + +else $as_nop + + TIMEOUTSTARTSEC="" + +fi + + + + INSTALL_LANGUAGES="" UNINSTALL_LANGUAGES="" LANGFILES="" diff --git a/scheduler/cups.service.in b/scheduler/cups.service.in index f0d7e2f886..7a6831b31c 100644 --- a/scheduler/cups.service.in +++ b/scheduler/cups.service.in @@ -8,6 +8,7 @@ Requires=cups.socket ExecStart=@sbindir@/cupsd -l Type=notify Restart=on-failure +@TIMEOUTSTARTSEC@ [Install] Also=cups.socket cups.path