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
01dd32bf
Unverified
Commit
01dd32bf
authored
Jul 01, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/lxc-checkconfig: list cgroup namespaces and rename confusing ns_cgroup entry
Link:
https://discuss.linuxcontainers.org/t/cgroup-namespace-required-in-lxc-checkconfig-and-config-cgroup-ns
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
49f1fbec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
lxc-checkconfig.in
src/lxc/cmd/lxc-checkconfig.in
+23
-6
No files found.
src/lxc/cmd/lxc-checkconfig.in
View file @
01dd32bf
...
@@ -24,11 +24,8 @@ is_set() {
...
@@ -24,11 +24,8 @@ is_set() {
return
$?
return
$?
}
}
is_enabled
()
{
show_enabled
()
{
mandatory
=
$2
RES
=
$1
is_set
$1
RES
=
$?
RET
=
1
RET
=
1
if
[
$RES
-eq
0
]
;
then
if
[
$RES
-eq
0
]
;
then
$SETCOLOR_SUCCESS
&&
echo
-n
"enabled"
&&
$SETCOLOR_NORMAL
$SETCOLOR_SUCCESS
&&
echo
-n
"enabled"
&&
$SETCOLOR_NORMAL
...
@@ -43,6 +40,23 @@ is_enabled() {
...
@@ -43,6 +40,23 @@ is_enabled() {
return
$RET
return
$RET
}
}
is_enabled
()
{
mandatory
=
$2
is_set
$1
show_enabled
$?
}
has_cgroup_ns
()
{
mandatory
=
no
if
[
-f
"/proc/self/ns/cgroup"
]
;
then
show_enabled 0
else
show_enabled 1
fi
}
is_probed
()
{
is_probed
()
{
lsmod |
grep
$1
>
/dev/null
lsmod |
grep
$1
>
/dev/null
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
...
@@ -144,6 +158,9 @@ echo "--- Control groups ---"
...
@@ -144,6 +158,9 @@ echo "--- Control groups ---"
echo
-n
"Cgroups: "
&&
is_enabled CONFIG_CGROUPS
echo
-n
"Cgroups: "
&&
is_enabled CONFIG_CGROUPS
echo
echo
echo
-n
"Cgroup namespace: "
&&
has_cgroup_ns
echo
print_cgroups
()
{
print_cgroups
()
{
# print all mountpoints for cgroup filesystems
# print all mountpoints for cgroup filesystems
awk
'$1 !~ /#/ && $3 == mp { print $2; } ; END { exit(0); } '
"mp=
$1
"
"
$2
"
;
awk
'$1 !~ /#/ && $3 == mp { print $2; } ; END { exit(0); } '
"mp=
$1
"
"
$2
"
;
...
@@ -179,7 +196,7 @@ if [ -f $CGROUP_MNT_PATH/cgroup.clone_children ]; then
...
@@ -179,7 +196,7 @@ if [ -f $CGROUP_MNT_PATH/cgroup.clone_children ]; then
echo
-n
"Cgroup v1 clone_children flag: "
&&
echo
-n
"Cgroup v1 clone_children flag: "
&&
$SETCOLOR_SUCCESS
&&
echo
"enabled"
&&
$SETCOLOR_NORMAL
$SETCOLOR_SUCCESS
&&
echo
"enabled"
&&
$SETCOLOR_NORMAL
else
else
echo
-n
"Cgroup n
amespace
: "
&&
is_enabled CONFIG_CGROUP_NS
yes
echo
-n
"Cgroup n
s_cgroup
: "
&&
is_enabled CONFIG_CGROUP_NS
yes
echo
echo
fi
fi
...
...
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