Merge pull request #11313 from nalind/leaked-bus-connection

utils.RunUnderSystemdScope(): always close Conn
This commit is contained in:
OpenShift Merge Robot
2021-08-24 03:50:56 -04:00
committed by GitHub

View File

@ -36,6 +36,7 @@ func RunUnderSystemdScope(pid int, slice string, unitName string) error {
return err
}
}
defer conn.Close()
properties = append(properties, systemdDbus.PropSlice(slice))
properties = append(properties, newProp("PIDs", []uint32{uint32(pid)}))
properties = append(properties, newProp("Delegate", true))
@ -54,7 +55,6 @@ func RunUnderSystemdScope(pid int, slice string, unitName string) error {
}
return err
}
defer conn.Close()
// Block until job is started
<-ch