cups icon indicating copy to clipboard operation
cups copied to clipboard

scheduler: add a systemd slice

Open tomodachi94 opened this issue 1 year ago • 2 comments

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)

tomodachi94 avatar Aug 24 '24 19:08 tomodachi94

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?

michaelrsweet avatar Aug 27 '24 20:08 michaelrsweet

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.)

tomodachi94 avatar Aug 27 '24 20:08 tomodachi94

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...

zdohnal avatar Aug 29 '24 10:08 zdohnal

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

tomodachi94 avatar Aug 29 '24 15:08 tomodachi94