MCPcopy Create free account
hub / github.com/containerd/cgroups / isUnitExists

Function isUnitExists

cgroup2/utils.go:432–439  ·  view source on GitHub ↗

isUnitExists returns true if the error is that a systemd unit already exists.

(err error)

Source from the content-addressed store, hash-verified

430
431// isUnitExists returns true if the error is that a systemd unit already exists.
432func isUnitExists(err error) bool {
433 if err != nil {
434 if dbusError, ok := err.(dbus.Error); ok {
435 return strings.Contains(dbusError.Name, "org.freedesktop.systemd1.UnitExists")
436 }
437 }
438 return false
439}
440
441func systemdUnitFromPath(path string) string {
442 _, unit := filepath.Split(path)

Callers 2

startUnitFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…