Skip to content

Commit

Permalink
runc delete: call systemd's reset-failed
Browse files Browse the repository at this point in the history
runc delete is supposed to remove all the container's artefacts.
In case systemd cgroup driver is used, and the systemd unit has failed
(e.g. oom-killed), systemd won't remove the unit (that is, unless the
"CollectMode: inactive-or-failed" property is set).

Call reset-failed from manager.Destroy so the failed unit will be
removed during "runc delete".

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Jun 6, 2023
1 parent 178464d commit f228e7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libcontainer/cgroups/systemd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ func stopUnit(cm *dbusConnManager, unitName string) error {
return errors.New("Timed out while waiting for systemd to remove " + unitName)
}
}

// In case of a failed unit, let systemd remove it.
_ = resetFailedUnit(cm, unitName)

return nil
}

Expand Down

0 comments on commit f228e7b

Please sign in to comment.