2016-11-22 19:32:10 +00:00
|
|
|
// +build linux
|
|
|
|
|
|
|
|
package aufs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os/exec"
|
|
|
|
"syscall"
|
|
|
|
|
2017-08-05 11:40:46 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
2016-11-22 19:32:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Unmount the target specified.
|
|
|
|
func Unmount(target string) error {
|
|
|
|
if err := exec.Command("auplink", target, "flush").Run(); err != nil {
|
|
|
|
logrus.Warnf("Couldn't run auplink before unmount %s: %s", target, err)
|
|
|
|
}
|
|
|
|
if err := syscall.Unmount(target, 0); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|