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
9ea09fb4
Unverified
Commit
9ea09fb4
authored
Feb 07, 2018
by
Marcos Paulo de Souza
Committed by
Christian Brauner
Feb 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: add check for lxc.cgroup.use
Closes #870. Signed-off-by:
Marcos Paulo de Souza
<
marcos.souza.org@gmail.com
>
parent
ff5976cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
cgroup.c
src/lxc/cgroups/cgroup.c
+10
-0
No files found.
src/lxc/cgroups/cgroup.c
View file @
9ea09fb4
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "cgroup.h"
#include "cgroup.h"
#include "conf.h"
#include "conf.h"
#include "initutils.h"
#include "log.h"
#include "log.h"
#include "start.h"
#include "start.h"
...
@@ -246,9 +247,14 @@ void prune_init_scope(char *cg)
...
@@ -246,9 +247,14 @@ void prune_init_scope(char *cg)
* is not mounted then it will be ignored. But if systemd is mounted, then it
* is not mounted then it will be ignored. But if systemd is mounted, then it
* must be setup so that lxc can create cgroups in it, else containers will
* must be setup so that lxc can create cgroups in it, else containers will
* fail.
* fail.
*
* cgroups listed in lxc.cgroup.use are also treated as crucial
*
*/
*/
bool
is_crucial_cgroup_subsystem
(
const
char
*
s
)
bool
is_crucial_cgroup_subsystem
(
const
char
*
s
)
{
{
const
char
*
cgroup_use
;
if
(
strcmp
(
s
,
"systemd"
)
==
0
)
if
(
strcmp
(
s
,
"systemd"
)
==
0
)
return
true
;
return
true
;
...
@@ -258,5 +264,9 @@ bool is_crucial_cgroup_subsystem(const char *s)
...
@@ -258,5 +264,9 @@ bool is_crucial_cgroup_subsystem(const char *s)
if
(
strcmp
(
s
,
"freezer"
)
==
0
)
if
(
strcmp
(
s
,
"freezer"
)
==
0
)
return
true
;
return
true
;
cgroup_use
=
lxc_global_config_value
(
"lxc.cgroup.use"
);
if
(
cgroup_use
&&
strstr
(
cgroup_use
,
s
))
return
true
;
return
false
;
return
false
;
}
}
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