diff options
Diffstat (limited to 'pkg/machine')
-rw-r--r-- | pkg/machine/ignition.go | 23 | ||||
-rw-r--r-- | pkg/machine/qemu/machine.go | 4 | ||||
-rw-r--r-- | pkg/machine/wsl/machine.go | 2 |
3 files changed, 26 insertions, 3 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{ diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go index e1870f1ac..eb7b35ece 100644 --- a/pkg/machine/qemu/machine.go +++ b/pkg/machine/qemu/machine.go @@ -390,12 +390,14 @@ func (v *MachineVM) Start(name string, _ machine.StartOptions) error { if err != nil { return err } - for running || !v.isListening() { + listening := v.isListening() + for !running || !listening { time.Sleep(100 * time.Millisecond) running, err = v.isRunning() if err != nil { return err } + listening = v.isListening() } } for _, mount := range v.Mounts { diff --git a/pkg/machine/wsl/machine.go b/pkg/machine/wsl/machine.go index c7d857954..3edf3ddf6 100644 --- a/pkg/machine/wsl/machine.go +++ b/pkg/machine/wsl/machine.go @@ -567,7 +567,7 @@ func installWslKernel() error { } // In case of unusual circumstances (e.g. race with installer actions) // retry a few times - message = "An error occured attempting the WSL Kernel update, retrying..." + message = "An error occurred attempting the WSL Kernel update, retrying..." fmt.Println(message) fmt.Fprintln(log, message) time.Sleep(backoff) |