From be0838ef707cdb7c952f62472bd2916dffb1ce78 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Mon, 29 Nov 2021 13:48:46 +0100 Subject: [PATCH] 2018957 - RFE: Implement IdleExitTimeout configuration during build 2018953 - RFE: Implement TimeoutStartSec configuration during build --- ...emd-timeoutstartsec-configure-option.patch | 57 +++++++++++++++++++ cups.spec | 6 ++ 2 files changed, 63 insertions(+) create mode 100644 0001-Add-with-systemd-timeoutstartsec-configure-option.patch diff --git a/0001-Add-with-systemd-timeoutstartsec-configure-option.patch b/0001-Add-with-systemd-timeoutstartsec-configure-option.patch new file mode 100644 index 0000000..c1a4657 --- /dev/null +++ b/0001-Add-with-systemd-timeoutstartsec-configure-option.patch @@ -0,0 +1,57 @@ +From 5233699867911d536a3a67184cc5bf3f8476e5e9 Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal +Date: Mon, 29 Nov 2021 13:18:18 +0100 +Subject: [PATCH] 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. +--- + CHANGES.md | 1 + + config-scripts/cups-defaults.m4 | 15 +++++++++++++++ + configure | 29 +++++++++++++++++++++++++++++ + scheduler/cups.service.in | 1 + + 4 files changed, 46 insertions(+) + +diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4 +index 240a95229..f44c11a13 100644 +--- a/config-scripts/cups-defaults.m4 ++++ b/config-scripts/cups-defaults.m4 +@@ -428,3 +428,18 @@ AS_IF([test $CUPS_WEBIF = Yes || test $CUPS_BROWSING = Yes], [ + SYSTEMD_WANTED_BY="$SYSTEMD_WANTED_BY multi-user.target"], [ + ]) + AC_SUBST([SYSTEMD_WANTED_BY]) ++ ++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/scheduler/cups.service.in b/scheduler/cups.service.in +index f0d7e2f88..7a6831b31 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 +-- +2.31.1 + diff --git a/cups.spec b/cups.spec index 3711d7f..c9f8527 100644 --- a/cups.spec +++ b/cups.spec @@ -101,6 +101,8 @@ Patch25: cups-fstack-strong.patch Patch26: 0001-cups-http-support.c-Apply-DigestOptions-to-RFC-2069-.patch # 2018957 - RFE: Implement IdleExitTimeout configuration during build Patch27: 0001-Add-with-idle-exit-timeout-configure-option.patch +# 2018953 - RFE: Implement TimeoutStartSec configuration during build +Patch28: 0001-Add-with-systemd-timeoutstartsec-configure-option.patch ##### Patches removed because IMHO they aren't no longer needed ##### but still I'll leave them in git in case their removal @@ -330,6 +332,8 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in %patch26 -p1 -b .no-digest-rfc2069 # 2018957 - RFE: Implement IdleExitTimeout configuration during build %patch27 -p1 -b .conf-idleexittimeout +# 2018953 - RFE: Implement TimeoutStartSec configuration during build +%patch28 -p1 -b .conf-timeoutstartsec %if %{lspp} @@ -380,6 +384,7 @@ export LDFLAGS="$LDFLAGS $RPM_LD_FLAGS -Wall -fstack-clash-protection -D_FORTIFY --enable-sync-on-close \ %if 0%{?rhel} --without-idle-exit-timeout \ + --without-systemd-timeoutstartsec \ %endif localedir=%{_datadir}/locale @@ -707,6 +712,7 @@ rm -f %{cups_serverbin}/backend/smb %changelog * Mon Nov 29 2021 Zdenek Dohnal - 1:2.3.3op2-11 - 2018957 - RFE: Implement IdleExitTimeout configuration during build +- 2018953 - RFE: Implement TimeoutStartSec configuration during build * Mon Nov 22 2021 Zdenek Dohnal - 1:2.3.3op2-11 - turn off MD5 Digest authentication by default, because MD5 is marked insecure