isUnitExists returns true if the error is that a systemd unit already exists.
(err error)
| 430 | |
| 431 | // isUnitExists returns true if the error is that a systemd unit already exists. |
| 432 | func 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 | |
| 441 | func systemdUnitFromPath(path string) string { |
| 442 | _, unit := filepath.Split(path) |
no outgoing calls
searching dependent graphs…