improve aufs cleanup and debugging

This commit is contained in:
Victor Vieux
2013-11-19 17:12:37 -08:00
parent f6629bbbd5
commit 43899a77bf
2 changed files with 23 additions and 6 deletions
+17 -3
View File
@@ -725,9 +725,23 @@ func NewRuntimeFromDirectory(config *DaemonConfig) (*Runtime, error) {
}
func (runtime *Runtime) Close() error {
runtime.networkManager.Close()
runtime.driver.Cleanup()
return runtime.containerGraph.Close()
errorsStrings := []string{}
if err := runtime.networkManager.Close(); err != nil {
utils.Errorf("runtime.networkManager.Close(): %s", err.Error())
errorsStrings = append(errorsStrings, err.Error())
}
if err := runtime.driver.Cleanup(); err != nil {
utils.Errorf("runtime.driver.Cleanup(): %s", err.Error())
errorsStrings = append(errorsStrings, err.Error())
}
if err := runtime.containerGraph.Close(); err != nil {
utils.Errorf("runtime.containerGraph.Close(): %s", err.Error())
errorsStrings = append(errorsStrings, err.Error())
}
if len(errorsStrings) > 0 {
return fmt.Errorf("%s", strings.Join(errorsStrings, ", "))
}
return nil
}
func (runtime *Runtime) Mount(container *Container) error {