From 74bc9966e0a06d1ed5693c03a3a894e0ef2ac827 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Mon, 2 Nov 2015 13:18:07 -0800 Subject: [PATCH] Log error from unmountVolumes on cleanup Signed-off-by: Alexander Morozov Upstream-commit: a20fea1823ccfb40d235607e8f7ce7ceff1b5afe Component: engine --- components/engine/daemon/container.go | 4 +++- components/engine/pkg/system/syscall_unix.go | 4 ++-- components/engine/pkg/system/syscall_windows.go | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/components/engine/daemon/container.go b/components/engine/daemon/container.go index f6250d37d9..b413173818 100644 --- a/components/engine/daemon/container.go +++ b/components/engine/daemon/container.go @@ -349,7 +349,9 @@ func (container *Container) cleanup() { container.daemon.unregisterExecCommand(eConfig) } - container.unmountVolumes(false) + if err := container.unmountVolumes(false); err != nil { + logrus.Warnf("%s cleanup: Failed to umount volumes: %v", container.ID, err) + } } // killSig sends the container the given signal. This wrapper for the diff --git a/components/engine/pkg/system/syscall_unix.go b/components/engine/pkg/system/syscall_unix.go index 50054765af..f1497c587e 100644 --- a/components/engine/pkg/system/syscall_unix.go +++ b/components/engine/pkg/system/syscall_unix.go @@ -6,6 +6,6 @@ import "syscall" // Unmount is a platform-specific helper function to call // the unmount syscall. -func Unmount(dest string) { - syscall.Unmount(dest, 0) +func Unmount(dest string) error { + return syscall.Unmount(dest, 0) } diff --git a/components/engine/pkg/system/syscall_windows.go b/components/engine/pkg/system/syscall_windows.go index 3a3a55b266..b3b94cb5eb 100644 --- a/components/engine/pkg/system/syscall_windows.go +++ b/components/engine/pkg/system/syscall_windows.go @@ -2,5 +2,6 @@ package system // Unmount is a platform-specific helper function to call // the unmount syscall. Not supported on Windows -func Unmount(dest string) { +func Unmount(dest string) error { + return nil }