Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
11 changes: 8 additions & 3 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ func RunUnderSystemdScope(pid int, slice, unitName string, properties ...systemd
properties = append(properties, systemdDbus.PropSlice(slice))
}
ch := make(chan string)
_, err = conn.StartTransientUnitContext(ctx, unitName, "replace", properties, ch)
if err != nil {
return err
for {
_, err = conn.StartTransientUnitContext(ctx, unitName, "replace", properties, ch)
if err == nil {
break
}
if !errors.Is(err, syscall.EAGAIN) {
return err
}
}
defer conn.Close()

Expand Down