9a9dc5ba | // +build linux |
699a1074 | package aufs |
75c866d6 | import ( |
2f67a62b | "os/exec" |
a02f67be | |
6f4d8470 | "github.com/Sirupsen/logrus" |
069fdc8a | "golang.org/x/sys/unix" |
75c866d6 | ) |
55885daa | // Unmount the target specified. |
75c866d6 | func Unmount(target string) error { |
2f67a62b | if err := exec.Command("auplink", target, "flush").Run(); err != nil { |
dbd9b7e1 | logrus.Warnf("Couldn't run auplink before unmount %s: %s", target, err) |
2f67a62b | } |
069fdc8a | if err := unix.Unmount(target, 0); err != nil { |
75c866d6 | return err } |
52f31657 | return nil |
75c866d6 | } |