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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
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
Hide 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):
...
@@ -271,7 +271,6 @@ class CGroupManager(Manager):
:param computer: slapos.format.Computer, extract necessary attributes
:param computer: slapos.format.Computer, extract necessary attributes
"""
"""
self
.
instance_root
=
computer
.
instance_root
self
.
instance_root
=
computer
.
instance_root
self
.
software_gid
=
computer
.
software_gid
logger
.
info
(
"Allowing "
+
self
.
__class__
.
__name__
)
logger
.
info
(
"Allowing "
+
self
.
__class__
.
__name__
)
def
__str__
(
self
):
def
__str__
(
self
):
...
@@ -315,8 +314,6 @@ class CGroupManager(Manager):
...
@@ -315,8 +314,6 @@ class CGroupManager(Manager):
fx
.
write
(
"1"
)
# manages it exclusively
fx
.
write
(
"1"
)
# manages it exclusively
with
open
(
cpu_path
+
"/cpuset.mems"
,
"wt"
)
as
fx
:
with
open
(
cpu_path
+
"/cpuset.mems"
,
"wt"
)
as
fx
:
fx
.
write
(
"0"
)
# it doesn't work without that
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
):
def
ensure_exlusive_cpu
(
self
):
"""Move processes among exclusive CPUSets based on software release demands.
"""Move processes among exclusive CPUSets based on software release demands.
...
@@ -416,7 +413,6 @@ class CGroupManager(Manager):
...
@@ -416,7 +413,6 @@ class CGroupManager(Manager):
"""If-Create folder and set group write permission."""
"""If-Create folder and set group write permission."""
if
not
os
.
path
.
exists
(
folder
):
if
not
os
.
path
.
exists
(
folder
):
os
.
mkdir
(
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
# make your life and testing easier and create mandatory files if they don't exist
mandatory_file_list
=
(
"tasks"
,
"cpuset.cpus"
)
mandatory_file_list
=
(
"tasks"
,
"cpuset.cpus"
)
for
mandatory_file
in
mandatory_file_list
:
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