Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
e1bd9f30
Commit
e1bd9f30
authored
Oct 01, 2021
by
Brad Davidson
Committed by
Brad Davidson
Oct 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't evacuate the root cgroup when rootless
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
a2efb6eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
init_linux.go
pkg/cli/cmds/init_linux.go
+7
-4
No files found.
pkg/cli/cmds/init_linux.go
View file @
e1bd9f30
...
...
@@ -7,6 +7,7 @@ import (
"os/signal"
"syscall"
"github.com/containerd/containerd/sys"
"github.com/erikdubbelboer/gspt"
"github.com/pkg/errors"
"github.com/rancher/k3s/pkg/version"
...
...
@@ -20,10 +21,12 @@ func HandleInit() error {
return
nil
}
// The root cgroup has to be empty to enable subtree_control, so evacuate it by placing
// ourselves in the init cgroup.
if
err
:=
cgrouputil
.
EvacuateCgroup2
(
"init"
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"failed to evacuate root cgroup"
)
if
!
sys
.
RunningInUserNS
()
{
// The root cgroup has to be empty to enable subtree_control, so evacuate it by placing
// ourselves in the init cgroup.
if
err
:=
cgrouputil
.
EvacuateCgroup2
(
"init"
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"failed to evacuate root cgroup"
)
}
}
pwd
,
err
:=
os
.
Getwd
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment