Skip to content

Commit

Permalink
Merge pull request #1683 from vikaschoudhary16/runc-systemd-race
Browse files Browse the repository at this point in the history
Fix race against systemd
  • Loading branch information
hqhq committed Jan 9, 2018
2 parents e6516b3 + d5b4a3e commit 96086e5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libcontainer/cgroups/systemd/apply_systemd.go
Expand Up @@ -295,10 +295,13 @@ func (m *Manager) Apply(pid int) error {
}
}

if _, err := theConn.StartTransientUnit(unitName, "replace", properties, nil); err != nil && !isUnitExists(err) {
statusChan := make(chan string)
if _, err := theConn.StartTransientUnit(unitName, "replace", properties, statusChan); err != nil && !isUnitExists(err) {
return err
}

<-statusChan

if err := joinCgroups(c, pid); err != nil {
return err
}
Expand Down

0 comments on commit 96086e5

Please sign in to comment.