Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler: add a systemd slice #1035

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

tomodachi94
Copy link
Contributor

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)

@michaelrsweet
Copy link
Member

I don't have strong feelings about this, but just for grins what happens if the version of systemd in use doesn't support slices?

Copy link
Member

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approving yet - the main question I have is, "what happens if the version of systemd in use doesn't support slices?"

@tomodachi94
Copy link
Contributor Author

tomodachi94 commented Aug 27, 2024

I don't have strong feelings about this, but just for grins what happens if the version of systemd in use doesn't support slices?

According to man systemd.unit(5), the Slice option added to all of the units will be warned about but otherwise ignored:

Unit files may contain additional options on top of those listed here. If systemd encounters an unknown option, it will write a warning log message but continue loading the unit.

It's unclear to me whether units with an unknown suffix are ignored (but I would assume they are).

(Side note: It looks like they were introduced in v205, released in 2013.)

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)``
@zdohnal
Copy link
Member

zdohnal commented Aug 29, 2024

AFAIK cups-lpd is rarely used (I have not seen it used in older environments, only cupsd and lpd backend for a destination) and going to be removed in 3.0, so I'm not sure if many users see the systemd slice benefits, but it does not harm to have it...

@tomodachi94
Copy link
Contributor Author

I am also planning on adding the Slice= value to cups-local and cups-browsed.

Copy link
Member

@zdohnal zdohnal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zdohnal zdohnal merged commit fa867a7 into OpenPrinting:master Aug 30, 2024
2 of 6 checks passed
@tomodachi94 tomodachi94 deleted the systemd-slice branch August 30, 2024 16:24
tomodachi94 added a commit to tomodachi94/cups-browsed that referenced this pull request Aug 30, 2024
See OpenPrinting/cups#1035 for rationale and an
explanation.

The ``system-cups.slice`` file included in the aformentioined PR is not
required; the ``system-cups`` slice will be automatically created if the
file is missing.
tomodachi94 added a commit to tomodachi94/cups-browsed that referenced this pull request Aug 30, 2024
See OpenPrinting/cups#1035 for rationale and an
explanation.

The ``system-cups.slice`` file included in the aforementioned PR is not
required; the ``system-cups`` slice will be automatically created if the
file is missing.
tomodachi94 added a commit to tomodachi94/cups-local that referenced this pull request Aug 30, 2024
See OpenPrinting/cups#1035 for rationale and an
explanation.

The ``system-cups.slice`` file included in the aforementioned PR is not
required; the ``system-cups`` slice will be automatically created if the
file is missing.
tillkamppeter pushed a commit to OpenPrinting/cups-browsed that referenced this pull request Sep 1, 2024
See OpenPrinting/cups#1035 for rationale and an
explanation.

The ``system-cups.slice`` file included in the aforementioned PR is not
required; the ``system-cups`` slice will be automatically created if the
file is missing.
KexyBiscuit added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Sep 26, 2024
- Works around CVE-2024-47176 (GHSA-rj88-6mr5-rcw8).
- One additional commit fixing OpenPrinting/cups#1035 included.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants