aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2021-06-30 20:22:13 -0700
committerGitHub <noreply@github.com>2021-06-30 20:22:13 -0700
commit90badb820159bbcda96f94285576fce47098ba3a (patch)
tree18205d60de4c4a6478b99162b30a9b5762164a6b
parentc8884719ea48361678c4568430a895bc91a326c1 (diff)
parenta66112c9d258f9060f453fec2a3b7c0136256f13 (diff)
downloadseaweedfs-90badb820159bbcda96f94285576fce47098ba3a.tar.xz
seaweedfs-90badb820159bbcda96f94285576fce47098ba3a.zip
Merge pull request #2172 from danielflira/master
-rw-r--r--weed/command/fuse.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/weed/command/fuse.go b/weed/command/fuse.go
index 3949d8f70..09dec388f 100644
--- a/weed/command/fuse.go
+++ b/weed/command/fuse.go
@@ -23,6 +23,7 @@ func runFuse(cmd *Command, args []string) bool {
option := strings.Builder{}
options := []parameter{}
masterProcess := true
+ fusermountPath := ""
// first parameter
i := 0
@@ -187,6 +188,8 @@ func runFuse(cmd *Command, args []string) bool {
} else {
panic(fmt.Errorf("readRetryTime: %s", err))
}
+ case "fusermount.path":
+ fusermountPath = parameter.value
}
}
@@ -213,6 +216,16 @@ func runFuse(cmd *Command, args []string) bool {
return true
}
+ if fusermountPath != "" {
+ if err := os.Setenv("PATH", fusermountPath); err != nil {
+ panic(fmt.Errorf("setenv: %s", err))
+ }
+ } else if os.Getenv("PATH") == "" {
+ if err := os.Setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin"); err != nil {
+ panic(fmt.Errorf("setenv: %s", err))
+ }
+ }
+
// just call "weed mount" command
return runMount(cmdMount, []string{})
}