Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
8cce8b59
Unverified
Commit
8cce8b59
authored
May 03, 2020
by
Christian Brauner
Committed by
Stéphane Graber
May 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: premount cgroups on cgroup2-only systems
Fixes: #3183 Cc: Thomas Moschny <thomas.moschny@gmx.de> Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
6001872d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
cgfsng.c
src/lxc/cgroups/cgfsng.c
+14
-1
No files found.
src/lxc/cgroups/cgfsng.c
View file @
8cce8b59
...
@@ -1712,11 +1712,24 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
...
@@ -1712,11 +1712,24 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
wants_force_mount
=
true
;
wants_force_mount
=
true
;
}
}
if
(
!
wants_force_mount
){
if
(
!
wants_force_mount
)
{
if
(
!
lxc_list_empty
(
&
handler
->
conf
->
keepcaps
))
if
(
!
lxc_list_empty
(
&
handler
->
conf
->
keepcaps
))
wants_force_mount
=
!
in_caplist
(
CAP_SYS_ADMIN
,
&
handler
->
conf
->
keepcaps
);
wants_force_mount
=
!
in_caplist
(
CAP_SYS_ADMIN
,
&
handler
->
conf
->
keepcaps
);
else
else
wants_force_mount
=
in_caplist
(
CAP_SYS_ADMIN
,
&
handler
->
conf
->
caps
);
wants_force_mount
=
in_caplist
(
CAP_SYS_ADMIN
,
&
handler
->
conf
->
caps
);
/*
* Most recent distro versions currently have init system that
* do support cgroup2 but do not mount it by default unless
* explicitly told so even if the host is cgroup2 only. That
* means they often will fail to boot. Fix this by pre-mounting
* cgroup2 by default. We will likely need to be doing this a
* few years until all distros have switched over to cgroup2 at
* which point we can safely assume that their init systems
* will mount it themselves.
*/
if
(
pure_unified_layout
(
ops
))
wants_force_mount
=
true
;
}
}
has_cgns
=
cgns_supported
();
has_cgns
=
cgns_supported
();
...
...
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