Merge pull request #500 from hqhq/hq_add_set_for_systemd

add Set support for systemd based cgroup
This commit is contained in:
Alexander Morozov 2015-04-15 12:23:39 -07:00
commit 84f43cdfac
1 changed files with 11 additions and 1 deletions

View File

@ -382,7 +382,17 @@ func (m *Manager) GetStats() (*cgroups.Stats, error) {
}
func (m *Manager) Set(container *configs.Config) error {
panic("not implemented")
for name, path := range m.Paths {
sys, ok := subsystems[name]
if !ok || !cgroups.PathExists(path) {
continue
}
if err := sys.Set(path, container.Cgroups); err != nil {
return err
}
}
return nil
}
func getUnitName(c *configs.Cgroup) string {