Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions cgroup2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ func dashesToPath(in string) string {
return path
}

func NewSystemd(slice, group string, pid int, resources *Resources) (*Manager, error) {
func NewSystemd(slice, group string, pid int, resources *Resources, properties []systemdDbus.Property) (*Manager, error) {
if slice == "" {
slice = defaultSlice
}
Expand All @@ -842,12 +842,14 @@ func NewSystemd(slice, group string, pid int, resources *Resources) (*Manager, e
}
defer conn.Close()

properties := []systemdDbus.Property{
systemdDbus.PropDescription("cgroup " + group),
newSystemdProperty("DefaultDependencies", false),
newSystemdProperty("MemoryAccounting", true),
newSystemdProperty("CPUAccounting", true),
newSystemdProperty("IOAccounting", true),
if len(properties) == 0 {
properties = []systemdDbus.Property{
systemdDbus.PropDescription("cgroup " + group),
newSystemdProperty("DefaultDependencies", false),
newSystemdProperty("MemoryAccounting", true),
newSystemdProperty("CPUAccounting", true),
newSystemdProperty("IOAccounting", true),
}
}

// if we create a slice, the parent is defined via a Wants=
Expand Down