2016-11-22 19:32:10 +00:00
|
|
|
// +build linux
|
|
|
|
|
|
|
|
package aufs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os/exec"
|
|
|
|
|
2017-08-05 11:40:46 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
2017-09-26 19:58:51 +00:00
|
|
|
"golang.org/x/sys/unix"
|
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)
|
|
|
|
}
|
2017-09-26 19:58:51 +00:00
|
|
|
if err := unix.Unmount(target, 0); err != nil {
|
2016-11-22 19:32:10 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|