diff options
| author | thephoenixofthevoid <49817252+thephoenixofthevoid@users.noreply.github.com> | 2021-06-26 10:50:03 +0300 |
|---|---|---|
| committer | Phoenix The Fallen <thephoenixofthevoid@gmail.com> | 2021-06-26 15:20:27 +0300 |
| commit | 8d70ba2eaab3394cd40bcc17db11eb2be188647a (patch) | |
| tree | f495862bf7b1eba0d8acb91368242517b9172934 /weed/command/fuse.go | |
| parent | 1cac2f2278b2344ac41ac882c7b21593f212d3bd (diff) | |
| download | seaweedfs-8d70ba2eaab3394cd40bcc17db11eb2be188647a.tar.xz seaweedfs-8d70ba2eaab3394cd40bcc17db11eb2be188647a.zip | |
Fix: Loosing environment variables at StartProcess
Diffstat (limited to 'weed/command/fuse.go')
| -rw-r--r-- | weed/command/fuse.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/weed/command/fuse.go b/weed/command/fuse.go index b66487bdf..3949d8f70 100644 --- a/weed/command/fuse.go +++ b/weed/command/fuse.go @@ -195,7 +195,9 @@ func runFuse(cmd *Command, args []string) bool { arg0 := os.Args[0] argv := append(os.Args, "-o", "child") - attr := os.ProcAttr{} + attr := os.ProcAttr{} + attr.Env = os.Environ() + child, err := os.StartProcess(arg0, argv, &attr) if err != nil { @@ -211,11 +213,6 @@ func runFuse(cmd *Command, args []string) bool { return true } - // I don't know why PATH environment variable is lost - if err := os.Setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"); err != nil { - panic(fmt.Errorf("setenv: %s", err)) - } - // just call "weed mount" command return runMount(cmdMount, []string{}) } |
