From a66112c9d258f9060f453fec2a3b7c0136256f13 Mon Sep 17 00:00:00 2001 From: danielflira Date: Thu, 1 Jul 2021 00:07:54 -0300 Subject: [PATCH] configurable fusermount path --- weed/command/fuse.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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{}) }