Skip to content

Commit

Permalink
Add --with-idle-exit-timeout configure option
Browse files Browse the repository at this point in the history
The option enables setting IdleExitTimeout to a desired value - f.e.
setting to zero will disable automatic shutdown, which is useful on servers,
where cupsd is expected to run even if there is no web interface, no jobs
and CUPS doesn't share queues.
  • Loading branch information
zdohnal committed Nov 29, 2021
1 parent ffe57eb commit d3bf52f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHANGES - OpenPrinting CUPS 2.4rc1 - 2021-11-12
Changes in CUPS v2.4.0 (TBA)
---------------------------

- Added configure option --with-idle-exit-timeout (Issue #294)
- DigestOptions now are applied for MD5 Digest authentication defined
by RFC 2069 as well (Issue #287)
- Fixed compilation on Solaris (Issue #293)
Expand Down
3 changes: 3 additions & 0 deletions conf/cupsd.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ DefaultAuthType Basic
# Web interface setting...
WebInterface @CUPS_WEBIF@

# Timeout after cupsd exits if idle (applied only if cupsd runs on-demand - with -l)
IdleExitTimeout @EXIT_TIMEOUT@

# Restrict access to the server...
<Location />
Order allow,deny
Expand Down
13 changes: 13 additions & 0 deletions config-scripts/cups-defaults.m4
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,16 @@ 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 default value of IdleExitTimeout
AC_ARG_WITH([idle_exit_timeout], AS_HELP_STRING([--with-idle-exit-timeout], [set the default value for IdleExitTimeout, default=60]), [
AS_IF([test "x$withval" = "xno"], [
EXIT_TIMEOUT=0
], [
EXIT_TIMEOUT=$withval
])
], [
EXIT_TIMEOUT=60
])

AC_SUBST([EXIT_TIMEOUT])
30 changes: 30 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
UNINSTALL_LANGUAGES
INSTALL_LANGUAGES
EXIT_TIMEOUT
SYSTEMD_WANTED_BY
CUPS_WEBIF
DEFAULT_IPP_PORT
Expand Down Expand Up @@ -939,6 +940,7 @@ with_snmp_address
with_snmp_community
with_ipp_port
enable_webif
with_idle_exit_timeout
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1665,6 +1667,9 @@ Optional Packages:
--with-snmp-address set SNMP query address, default=auto
--with-snmp-community set SNMP community, default=public
--with-ipp-port set port number for IPP, default=631
--with-idle-exit-timeout
set the default value for IdleExitTimeout,
default=60
Some influential environment variables:
CC C compiler command
Expand Down Expand Up @@ -12104,6 +12109,31 @@ fi



# Check whether --with-idle_exit_timeout was given.
if test ${with_idle_exit_timeout+y}
then :
withval=$with_idle_exit_timeout;
if test "x$withval" = "xno"
then :

EXIT_TIMEOUT=0

else $as_nop

EXIT_TIMEOUT=$withval

fi

else $as_nop

EXIT_TIMEOUT=60

fi





INSTALL_LANGUAGES=""
UNINSTALL_LANGUAGES=""
LANGFILES=""
Expand Down

0 comments on commit d3bf52f

Please sign in to comment.