Skip to content

Commit

Permalink
utils: return error message from StartTransientUnit
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Sep 20, 2021
1 parent 4caca09 commit eea5d25
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/utils_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func RunUnderSystemdScope(pid int, slice string, unitName string) error {
// On errors check if the cgroup already exists, if it does move the process there
if props, err := conn.GetUnitTypeProperties(unitName, "Scope"); err == nil {
if cgroup, ok := props["ControlGroup"].(string); ok && cgroup != "" {
if err := moveUnderCgroup(cgroup, "", []uint32{uint32(pid)}); err != nil {
return err
if err := moveUnderCgroup(cgroup, "", []uint32{uint32(pid)}); err == nil {
return nil
}
return nil
// On errors return the original error message we got from StartTransientUnit.
}
}
return err
Expand Down

0 comments on commit eea5d25

Please sign in to comment.