archlinux / contrib

Arch contrib scripts
GNU General Public License v2.0
64 stars 19 forks source link

Add support for services with a delegate cgroup subhierarchy in checkservices + ignore services in machine.slice by default #79

Closed Antiz96 closed 3 months ago

Antiz96 commented 3 months ago

This commit adds support for services with a delegate cgroup subhierarchy and introduces the -m/-M option to include or not services in machine.slice (default is no).

Parts of the patch are taken from https://github.com/archlinux/contrib/issues/61#issuecomment-1986888476 & https://github.com/archlinux/contrib/issues/61#issuecomment-2211966735

Fixes https://github.com/archlinux/contrib/issues/61

lahwaacz commented 3 months ago

Hmm, after this change checkservices tells me that some systemd-nspawn@... services would be restarted which might not be a good thing (it would restart the whole container with potentially many services). We might ignore all units in the machine.slice, similar to user.slice, or at least make it configurable.

Antiz96 commented 3 months ago

Hmm, after this change checkservices tells me that some systemd-nspawn@... services would be restarted which might not be a good thing (it would restart the whole container with potentially many services). We might ignore all units in the machine.slice, similar to user.slice, or at least make it configurable.

Sounds reasonable, I'll work on that in a few.

Antiz96 commented 3 months ago

@lahwaacz I added the -m|-M option to ignore/include services in machine.slice (ignored by default), similar to how it is done with the -u|-U option for the user.slice.

injiniero commented 3 months ago

Thank you for adding the -m/-M support, but you forgot to add the Mm options to getops

while getopts 'AahFfLlPpRrSsUuMmZzi:' opt; do
Antiz96 commented 3 months ago

Thank you for adding the -m/-M support, but you forgot to add the Mm options to getops

while getopts 'AahFfLlPpRrSsUuMmZzi:' opt; do

Oops, indeed. Sorry about that, fixing it right now!

Antiz96 commented 3 months ago

@injiniero Fixed in https://github.com/archlinux/contrib/pull/81, thanks for the heads up!

Antiz96 commented 3 months ago

I probably won't cut a new release just for that though, I'll patch the archlinux-contrib package in [extra] directly instead.

EDIT: Done