Skip to content

Commit

Permalink
Merge pull request #577 from crosbymichael/m-named-cgroup
Browse files Browse the repository at this point in the history
Move the process outside of the systemd cgroup
  • Loading branch information
crosbymichael committed Feb 19, 2016
2 parents 0107c7f + 47f16e8 commit ee6a72d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions libcontainer/cgroups/fs/apply_raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var (
&NetPrioGroup{},
&PerfEventGroup{},
&FreezerGroup{},
&NameGroup{GroupName: "name=systemd", Join: true},
}
CgroupProcesses = "cgroup.procs"
HugePageSizes, _ = cgroups.GetHugePageSize()
Expand Down
8 changes: 8 additions & 0 deletions libcontainer/cgroups/fs/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ import (

type NameGroup struct {
GroupName string
Join bool
}

func (s *NameGroup) Name() string {
return s.GroupName
}

func (s *NameGroup) Apply(d *cgroupData) error {
if s.Join {
// ignore errors if the named cgroup does not exist
d.join(s.GroupName)
}
return nil
}

Expand All @@ -24,6 +29,9 @@ func (s *NameGroup) Set(path string, cgroup *configs.Cgroup) error {
}

func (s *NameGroup) Remove(d *cgroupData) error {
if s.Join {
removePath(d.path(s.GroupName))
}
return nil
}

Expand Down

0 comments on commit ee6a72d

Please sign in to comment.