diff options
| author | danielflira <danielflira@gmail.com> | 2021-07-01 00:07:54 -0300 |
|---|---|---|
| committer | danielflira <danielflira@gmail.com> | 2021-07-01 00:07:54 -0300 |
| commit | a66112c9d258f9060f453fec2a3b7c0136256f13 (patch) | |
| tree | 18205d60de4c4a6478b99162b30a9b5762164a6b /weed/command/fuse.go | |
| parent | c8884719ea48361678c4568430a895bc91a326c1 (diff) | |
| download | seaweedfs-a66112c9d258f9060f453fec2a3b7c0136256f13.tar.xz seaweedfs-a66112c9d258f9060f453fec2a3b7c0136256f13.zip | |
configurable fusermount path
Diffstat (limited to 'weed/command/fuse.go')
| -rw-r--r-- | weed/command/fuse.go | 13 |
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{}) } |
