-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13061 from flouthoc/podman-vm-delegate-subsystem
ignition, machine: delegate `cpu,io,memory,pid cgroup controllers` to machine's non-root users.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -246,6 +246,10 @@ netns="bridge" | |
` | ||
rootContainers := `[engine] | ||
machine_enabled=true | ||
` | ||
|
||
delegateConf := `[Service] | ||
Delegate=memory pids cpu io | ||
` | ||
|
||
// Add a fake systemd service to get the user socket rolling | ||
|
@@ -280,6 +284,24 @@ machine_enabled=true | |
Mode: intToPtr(0744), | ||
}, | ||
}) | ||
|
||
// Set delegate.conf so cpu,io subsystem is delegated to non-root users as well for cgroupv2 | ||
// by default | ||
files = append(files, File{ | ||
Node: Node{ | ||
Group: getNodeGrp("root"), | ||
Path: "/etc/systemd/system/[email protected]/delegate.conf", | ||
User: getNodeUsr("root"), | ||
}, | ||
FileEmbedded1: FileEmbedded1{ | ||
Append: nil, | ||
Contents: Resource{ | ||
Source: encodeDataURLPtr(delegateConf), | ||
}, | ||
Mode: intToPtr(0644), | ||
}, | ||
}) | ||
|
||
// Add a file into linger | ||
files = append(files, File{ | ||
Node: Node{ | ||
|