mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
configurable fusermount path
This commit is contained in:
parent
c8884719ea
commit
a66112c9d2
|
@ -23,6 +23,7 @@ func runFuse(cmd *Command, args []string) bool {
|
||||||
option := strings.Builder{}
|
option := strings.Builder{}
|
||||||
options := []parameter{}
|
options := []parameter{}
|
||||||
masterProcess := true
|
masterProcess := true
|
||||||
|
fusermountPath := ""
|
||||||
|
|
||||||
// first parameter
|
// first parameter
|
||||||
i := 0
|
i := 0
|
||||||
|
@ -187,6 +188,8 @@ func runFuse(cmd *Command, args []string) bool {
|
||||||
} else {
|
} else {
|
||||||
panic(fmt.Errorf("readRetryTime: %s", err))
|
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
|
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
|
// just call "weed mount" command
|
||||||
return runMount(cmdMount, []string{})
|
return runMount(cmdMount, []string{})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue