2018957 - RFE: Implement IdleExitTimeout configuration during build

2018953 - RFE: Implement TimeoutStartSec configuration during build
This commit is contained in:
Zdenek Dohnal 2021-11-29 13:48:46 +01:00
parent 141c2472d4
commit be0838ef70
2 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,57 @@
From 5233699867911d536a3a67184cc5bf3f8476e5e9 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
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

View File

@ -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 <zdohnal@redhat.com> - 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 <zdohnal@redhat.com> - 1:2.3.3op2-11
- turn off MD5 Digest authentication by default, because MD5 is marked insecure