diff options
| author | chrislu <chris.lu@gmail.com> | 2022-02-10 20:46:53 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-02-10 20:46:53 -0800 |
| commit | 7a0c35674ca59fd96a5389ddebb3c7c14476d6a4 (patch) | |
| tree | cf8f19a480ddef6381edcad72532cd8b052efab5 /weed/command | |
| parent | c3f9d9fa2edde613c8a00da7b1252fa524fd2a0d (diff) | |
| download | seaweedfs-7a0c35674ca59fd96a5389ddebb3c7c14476d6a4.tar.xz seaweedfs-7a0c35674ca59fd96a5389ddebb3c7c14476d6a4.zip | |
clean up previously mounted folder
Diffstat (limited to 'weed/command')
| -rw-r--r-- | weed/command/mount2_std.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/weed/command/mount2_std.go b/weed/command/mount2_std.go index 795a7864c..60edb71b0 100644 --- a/weed/command/mount2_std.go +++ b/weed/command/mount2_std.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/mount" + "github.com/chrislusf/seaweedfs/weed/mount/unmount" "github.com/hanwen/go-fuse/v2/fs" "net/http" "os" @@ -43,6 +44,12 @@ func RunMount2(option *Mount2Options, umask os.FileMode) bool { opts := &fs.Options{} opts.Debug = true + + unmount.Unmount(*option.dir) + grace.OnInterrupt(func() { + unmount.Unmount(*option.dir) + }) + server, err := fs.Mount(*option.dir, &mount.WeedFS{}, opts) if err != nil { glog.Fatalf("Mount fail: %v", err) |
