try again on EAGAIN from dbus
@@ -69,10 +69,15 @@ func RunUnderSystemdScope(pid int, slice, unitName string, properties ...systemd
properties = append(properties, systemdDbus.PropSlice(slice))
}
ch := make(chan string)
+ for {
_, err = conn.StartTransientUnitContext(ctx, unitName, "replace", properties, ch)
- if err != nil {
+ if err == nil {
+ break
+ }
+ if !errors.Is(err, syscall.EAGAIN) {
return err
}
+ }
defer conn.Close()
// Block until job is started
