mount.go 396 B

123456789101112131415161718192021
  1. // +build linux
  2. package aufs
  3. import (
  4. "os/exec"
  5. "syscall"
  6. "github.com/Sirupsen/logrus"
  7. )
  8. // Unmount the target specified.
  9. func Unmount(target string) error {
  10. if err := exec.Command("auplink", target, "flush").Run(); err != nil {
  11. logrus.Warnf("Couldn't run auplink before unmount %s: %s", target, err)
  12. }
  13. if err := syscall.Unmount(target, 0); err != nil {
  14. return err
  15. }
  16. return nil
  17. }