Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
02b9607e
Commit
02b9607e
authored
Jun 09, 2017
by
Tomáš Peterka
Committed by
Rafael Monnerat
Jun 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[format] cgroup are managed solely by root user and slapformat
parent
72aefc89
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
4 deletions
+0
-4
slapos/format.py
slapos/format.py
+0
-4
No files found.
slapos/format.py
View file @
02b9607e
...
...
@@ -271,7 +271,6 @@ class CGroupManager(Manager):
:param computer: slapos.format.Computer, extract necessary attributes
"""
self
.
instance_root
=
computer
.
instance_root
self
.
software_gid
=
computer
.
software_gid
logger
.
info
(
"Allowing "
+
self
.
__class__
.
__name__
)
def
__str__
(
self
):
...
...
@@ -315,8 +314,6 @@ class CGroupManager(Manager):
fx
.
write
(
"1"
)
# manages it exclusively
with
open
(
cpu_path
+
"/cpuset.mems"
,
"wt"
)
as
fx
:
fx
.
write
(
"0"
)
# it doesn't work without that
os
.
chown
(
cpu_path
+
"/tasks"
,
-
1
,
self
.
software_gid
)
os
.
chmod
(
cpu_path
+
"/tasks"
,
0o664
)
def
ensure_exlusive_cpu
(
self
):
"""Move processes among exclusive CPUSets based on software release demands.
...
...
@@ -416,7 +413,6 @@ class CGroupManager(Manager):
"""If-Create folder and set group write permission."""
if
not
os
.
path
.
exists
(
folder
):
os
.
mkdir
(
folder
)
os
.
chown
(
folder
,
-
1
,
self
.
software_gid
)
# make your life and testing easier and create mandatory files if they don't exist
mandatory_file_list
=
(
"tasks"
,
"cpuset.cpus"
)
for
mandatory_file
in
mandatory_file_list
:
...
...
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