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 init.wrapper to force switch to legacy cgroups after initramfs #62

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

jepio
Copy link
Member

@jepio jepio commented Feb 22, 2022

add init.wrapper to force switch to legacy cgroups after initramfs

init.wrapper attempts to disable cgroup controllers, unmount cgroup2,
and then inject (using a bind mount) additional kernel command line
arguments. These kernel parameters are used by systemd to proceed to
mount legacy cygroups.

How to use

To be used with flatcar/bootengine#35

Testing done

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)

@jepio jepio requested a review from a team February 22, 2022 14:40
init.wrapper attempts to disable cgroup controllers, unmount cgroup2,
and then inject (using a bind mount) additional kernel command line
arguments. These kernel parameters are used by systemd to proceed to
mount legacy cygroups.

We use systemd in the initramfs.  If a systemd unit specifies resource
control options, systemd will automatically enable the controller for
the whole path from unit cgroup to root. This causes the cgroup
controller to be busy, and prevents it from being moved from cgroup v2
to cgroup v1.

Attempt to remove all cgroups that we can (none of them should have any
pids because we just switched_root) and disable any controllers to allow
re-binding. Do so before unmounting the initramfs cgroup2 hierarchy.
@jepio jepio merged commit e72d7a4 into flatcar-master Mar 1, 2022
@jepio jepio deleted the jepio/runtime-revert-to-cgroupv1 branch March 1, 2022 08:06
jepio added a commit to flatcar-archive/coreos-overlay that referenced this pull request Mar 1, 2022
…ange

This pulls in flatcar/bootengine#35 and
flatcar/init#62, which enable boot time switching
back to legacy cgroups by creating a flag files (/etc/flatcar-cgroupv1) from
ignition.
jepio added a commit to flatcar-archive/coreos-overlay that referenced this pull request Mar 1, 2022
…ange

This pulls in flatcar/bootengine#35 and
flatcar/init#62, which enable boot time switching
back to legacy cgroups by creating a flag files (/etc/flatcar-cgroupv1) from
ignition.
jepio added a commit that referenced this pull request Mar 1, 2022
add init.wrapper to force switch to legacy cgroups after initramfs
jepio added a commit to flatcar-archive/coreos-overlay that referenced this pull request Mar 1, 2022
…ange

This pulls in flatcar/bootengine#35 and
flatcar/init#62, which enable boot time switching
back to legacy cgroups by creating a flag files (/etc/flatcar-cgroupv1) from
ignition.
jepio added a commit that referenced this pull request Mar 17, 2022
add init.wrapper to force switch to legacy cgroups after initramfs
jepio added a commit to flatcar-archive/coreos-overlay that referenced this pull request Mar 17, 2022
…ange

This pulls in flatcar/bootengine#35 and
flatcar/init#62, which enable boot time switching
back to legacy cgroups by creating a flag files (/etc/flatcar-cgroupv1) from
ignition.

Also contains the subsequent bugfix to coreos-init:
c21ee83 "coreos-base/coreos-init: move processes to root cgroup before unbinding controllers"
t-lo pushed a commit to flatcar/scripts that referenced this pull request Apr 13, 2023
…ange

This pulls in flatcar/bootengine#35 and
flatcar/init#62, which enable boot time switching
back to legacy cgroups by creating a flag files (/etc/flatcar-cgroupv1) from
ignition.

Also contains the subsequent bugfix to coreos-init:
c21ee83df0a2302c0b7cfa375a5f191c14800ec8 "coreos-base/coreos-init: move processes to root cgroup before unbinding controllers"
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.

2 participants