2013-10-31 21:07:54 -04:00
|
|
|
package aufs
|
2013-03-21 01:41:03 -04:00
|
|
|
|
|
|
|
import (
|
2013-06-04 14:30:47 -04:00
|
|
|
"github.com/dotcloud/docker/utils"
|
|
|
|
"os/exec"
|
2013-03-21 01:41:03 -04:00
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Unmount(target string) error {
|
2013-06-04 14:30:47 -04:00
|
|
|
if err := exec.Command("auplink", target, "flush").Run(); err != nil {
|
2013-10-08 03:54:47 -04:00
|
|
|
utils.Errorf("[warning]: couldn't run auplink before unmount: %s", err)
|
2013-06-04 14:30:47 -04:00
|
|
|
}
|
2013-03-21 01:41:03 -04:00
|
|
|
if err := syscall.Unmount(target, 0); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2013-11-08 13:17:51 -05:00
|
|
|
return nil
|
2013-03-21 01:41:03 -04:00
|
|
|
}
|