Merge pull request #500 from hqhq/hq_add_set_for_systemd
add Set support for systemd based cgroup
This commit is contained in:
commit
84f43cdfac
|
@ -382,7 +382,17 @@ func (m *Manager) GetStats() (*cgroups.Stats, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) Set(container *configs.Config) 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 {
|
func getUnitName(c *configs.Cgroup) string {
|
||||||
|
|
Loading…
Reference in New Issue