diff options
Diffstat (limited to 'pkg/machine/ignition.go')
-rw-r--r-- | pkg/machine/ignition.go | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/pkg/machine/ignition.go b/pkg/machine/ignition.go index 09228553c..206c9144f 100644 --- a/pkg/machine/ignition.go +++ b/pkg/machine/ignition.go @@ -243,12 +243,15 @@ ExecStart=/usr/bin/sleep infinity ` containers := `[containers] netns="bridge" -rootless_networking="cni" ` rootContainers := `[engine] machine_enabled=true ` + delegateConf := `[Service] +Delegate=memory pids cpu io +` + // Add a fake systemd service to get the user socket rolling files = append(files, File{ Node: Node{ @@ -281,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/user@.service.d/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{ |