From a343beed3837694de55c21343a24e81df814acbc Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Mon, 2 Sep 2024 10:31:13 +0200 Subject: [PATCH] scheduler: add a systemd slice From the systemd documentation[1]: > A slice unit is a concept for hierarchically managing resources of a group of processes. Benefits of collecting our two systemd services into a slice include * ease of configuring resource limits on the entire CUPS system, * ``systemctl status`` showing the CUPS units in an indented subtree, making it more organized, * and the possibility of viewing all interlaced logs from all of the CUPS daemons using ``journalctl -u system-cups.slice``. [1]: https://www.freedesktop.org/software/systemd/man/latest/systemd.slice.html or ``man systemd.slice(5)`` --- scheduler/Makefile | 1 + scheduler/cups-lpdAT.service.in | 1 + scheduler/cups.service.in | 1 + scheduler/system-cups.slice | 3 +++ 4 files changed, 6 insertions(+) create mode 100644 scheduler/system-cups.slice diff --git a/scheduler/Makefile b/scheduler/Makefile index 590e873cf9..57b1693872 100644 --- a/scheduler/Makefile +++ b/scheduler/Makefile @@ -195,6 +195,7 @@ install-data: if test "x$(SYSTEMD_DIR)" != x; then \ echo Installing systemd configuration files...; \ $(INSTALL_DIR) $(BUILDROOT)$(SYSTEMD_DIR); \ + $(INSTALL_DATA) system-cups.slice $(BUILDROOT)$(SYSTEMD_DIR); \ $(INSTALL_DATA) cups.path $(BUILDROOT)$(SYSTEMD_DIR); \ $(INSTALL_DATA) cups.service $(BUILDROOT)$(SYSTEMD_DIR); \ $(INSTALL_DATA) cups.socket $(BUILDROOT)$(SYSTEMD_DIR); \ diff --git a/scheduler/cups-lpdAT.service.in b/scheduler/cups-lpdAT.service.in index 5c7827340b..88cbfcf1a7 100644 --- a/scheduler/cups-lpdAT.service.in +++ b/scheduler/cups-lpdAT.service.in @@ -6,4 +6,5 @@ Documentation=man:cups-lpd(8) ExecStart=-@CUPS_SERVERBIN@/daemon/cups-lpd StandardInput=socket User=@CUPS_USER@ +Slice=system-cups.slice diff --git a/scheduler/cups.service.in b/scheduler/cups.service.in index 7a6831b31c..72ca3f4d7e 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 +Slice=system-cups.slice @TIMEOUTSTARTSEC@ [Install] diff --git a/scheduler/system-cups.slice b/scheduler/system-cups.slice new file mode 100644 index 0000000000..53ef2fa71e --- /dev/null +++ b/scheduler/system-cups.slice @@ -0,0 +1,3 @@ +[Unit] +Description=CUPS Slice +Documentation=man:cups(1)