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

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

Merged
merged 1 commit into from
Jul 20, 2024

Conversation

Antiz96
Copy link
Contributor

@Antiz96 Antiz96 commented Jul 15, 2024

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 #61 (comment) & #61 (comment)

Fixes #61

@Antiz96 Antiz96 changed the title Add support for services with a delegate cgroup subhierarchy Add support for services with a delegate cgroup subhierarchy in checkservices Jul 15, 2024
@lahwaacz
Copy link
Contributor

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
Copy link
Contributor Author

Antiz96 commented Jul 15, 2024

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 Antiz96 changed the title Add support for services with a delegate cgroup subhierarchy in checkservices Add support for services with a delegate cgroup subhierarchy in checkservices + ignore services in machine.slice by default Jul 15, 2024
…services + ignore services in machine.slice by default

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 #61 (comment) & #61 (comment)

Fixes #61
@Antiz96
Copy link
Contributor Author

Antiz96 commented Jul 15, 2024

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

Copy link
Contributor

@lahwaacz lahwaacz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for looking into this! 🎉

@Antiz96 Antiz96 merged commit e727aa0 into master Jul 20, 2024
1 check passed
@Antiz96 Antiz96 deleted the cgroup_delegation branch July 20, 2024 09:43
@injiniero
Copy link

injiniero commented Jul 20, 2024

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

while getopts 'AahFfLlPpRrSsUuMmZzi:' opt; do

@Antiz96
Copy link
Contributor Author

Antiz96 commented Jul 20, 2024

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
Copy link
Contributor Author

Antiz96 commented Jul 20, 2024

@injiniero Fixed in #81, thanks for the heads up!

@Antiz96
Copy link
Contributor Author

Antiz96 commented Jul 20, 2024

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

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.

Checkservices. Unable to find/parse PID for systemd-udevd and shadowsocks service
3 participants