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
8ba58490
Unverified
Commit
8ba58490
authored
Aug 28, 2019
by
Stéphane Graber
Committed by
GitHub
Aug 28, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3129 from brauner/2019-08-28/fix_cgroup_braino
cgroups: initialize cgroup root directory
parents
f327a062
6607d6e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
cgfsng.c
src/lxc/cgroups/cgfsng.c
+6
-8
No files found.
src/lxc/cgroups/cgfsng.c
View file @
8ba58490
...
@@ -1764,7 +1764,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
...
@@ -1764,7 +1764,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
struct
lxc_handler
*
handler
,
struct
lxc_handler
*
handler
,
const
char
*
root
,
int
type
)
const
char
*
root
,
int
type
)
{
{
__do_free
char
*
tmpfspath
=
NULL
;
__do_free
char
*
cgroup_root
=
NULL
;
int
ret
;
int
ret
;
bool
has_cgns
=
false
,
retval
=
false
,
wants_force_mount
=
false
;
bool
has_cgns
=
false
,
retval
=
false
,
wants_force_mount
=
false
;
...
@@ -1796,23 +1796,21 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
...
@@ -1796,23 +1796,21 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
type
=
LXC_AUTO_CGROUP_FULL_MIXED
;
type
=
LXC_AUTO_CGROUP_FULL_MIXED
;
if
(
ops
->
cgroup_layout
==
CGROUP_LAYOUT_UNIFIED
)
{
if
(
ops
->
cgroup_layout
==
CGROUP_LAYOUT_UNIFIED
)
{
__do_free
char
*
unified_path
=
NULL
;
cgroup_root
=
must_make_path
(
root
,
"/sys/fs/cgroup"
,
NULL
);
unified_path
=
must_make_path
(
root
,
"/sys/fs/cgroup"
,
NULL
);
if
(
has_cgns
&&
wants_force_mount
)
{
if
(
has_cgns
&&
wants_force_mount
)
{
/* If cgroup namespaces are supported but the container
/* If cgroup namespaces are supported but the container
* will not have CAP_SYS_ADMIN after it has started we
* will not have CAP_SYS_ADMIN after it has started we
* need to mount the cgroups manually.
* need to mount the cgroups manually.
*/
*/
return
cg_mount_in_cgroup_namespace
(
type
,
ops
->
unified
,
return
cg_mount_in_cgroup_namespace
(
type
,
ops
->
unified
,
unified_path
)
==
0
;
cgroup_root
)
==
0
;
}
}
return
cg_mount_cgroup_full
(
type
,
ops
->
unified
,
unified_path
)
==
0
;
return
cg_mount_cgroup_full
(
type
,
ops
->
unified
,
cgroup_root
)
==
0
;
}
}
/* mount tmpfs */
/* mount tmpfs */
ret
=
safe_mount
(
NULL
,
tmpfspath
,
"tmpfs"
,
ret
=
safe_mount
(
NULL
,
cgroup_root
,
"tmpfs"
,
MS_NOSUID
|
MS_NODEV
|
MS_NOEXEC
|
MS_RELATIME
,
MS_NOSUID
|
MS_NODEV
|
MS_NOEXEC
|
MS_RELATIME
,
"size=10240k,mode=755"
,
root
);
"size=10240k,mode=755"
,
root
);
if
(
ret
<
0
)
if
(
ret
<
0
)
...
@@ -1827,7 +1825,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
...
@@ -1827,7 +1825,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
continue
;
continue
;
controller
++
;
controller
++
;
controllerpath
=
must_make_path
(
tmpfspath
,
controller
,
NULL
);
controllerpath
=
must_make_path
(
cgroup_root
,
controller
,
NULL
);
if
(
dir_exists
(
controllerpath
))
if
(
dir_exists
(
controllerpath
))
continue
;
continue
;
...
...
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