]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add --with-systemd-timeoutstartsec configure option 298/head
authorZdenek Dohnal <zdohnal@redhat.com>
Mon, 29 Nov 2021 12:18:18 +0000 (13:18 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Mon, 29 Nov 2021 13:53:55 +0000 (14:53 +0100)
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
config-scripts/cups-defaults.m4
configure
scheduler/cups.service.in

index c13a2e488616c35ccf154b0902a952a16fd96fc4..53ba647f76609fcdeaec6317e91dfa97c9b72e22 100644 (file)
@@ -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)
index 9420e1510e6c80766083234b0c03ee32c39d53b4..d153fbc71e459ff3f742e359a58bd0a756d51bc7 100644 (file)
@@ -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])
index b8b99938b17e78bac9eb57cd5a6938564d6dc922..d5b5ca0dfaf695185d439c919c5ffc72e0c0f0ef 100755 (executable)
--- 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
 
 
 
+# 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=""
index f0d7e2f8861d570f8e558b5cc12cdd4a799d90db..7a6831b31cc4607c548a4ea1597b25ee148359e8 100644 (file)
@@ -8,6 +8,7 @@ Requires=cups.socket
 ExecStart=@sbindir@/cupsd -l
 Type=notify
 Restart=on-failure
+@TIMEOUTSTARTSEC@
 
 [Install]
 Also=cups.socket cups.path