mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Merge pull request #3297 from kolyshkin/1.0-3226
[1.0] Remove sub cgroup when container exits
This commit is contained in:
@@ -5,7 +5,6 @@ package systemd
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -307,9 +306,10 @@ func (m *unifiedManager) Destroy() error {
|
||||
return err
|
||||
}
|
||||
|
||||
// XXX this is probably not needed, systemd should handle it
|
||||
err := os.Remove(m.path)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
// systemd 239 do not remove sub-cgroups.
|
||||
err := cgroups.RemovePath(m.path)
|
||||
// cgroups.RemovePath has handled ErrNotExist
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user