aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/fuse.go5
-rw-r--r--weed/command/master.go8
2 files changed, 12 insertions, 1 deletions
diff --git a/weed/command/fuse.go b/weed/command/fuse.go
index cf088022c..5beeb3b1f 100644
--- a/weed/command/fuse.go
+++ b/weed/command/fuse.go
@@ -47,7 +47,10 @@ func runFuse(cmd *Command, args []string) bool {
for i++; i < rawArgsLen && rawArgs[i] != ' '; i++ {
option.WriteByte(rawArgs[i])
}
- options = append(options, parameter{option.String(), "true"})
+ // ignore "-o"
+ if option.String() != "o" {
+ options = append(options, parameter{option.String(), "true"})
+ }
option.Reset()
// equal separator start option with pending value
diff --git a/weed/command/master.go b/weed/command/master.go
index f20b2dc62..a74389b1f 100644
--- a/weed/command/master.go
+++ b/weed/command/master.go
@@ -2,6 +2,7 @@ package command
import (
"fmt"
+ hashicorpRaft "github.com/hashicorp/raft"
"net/http"
"os"
"path"
@@ -253,6 +254,13 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
go httpS.Serve(masterListener)
}
+ grace.OnInterrupt(ms.Shutdown)
+ grace.OnInterrupt(grpcS.GracefulStop)
+ grace.OnReload(func() {
+ if ms.Topo.HashicorpRaft != nil && ms.Topo.HashicorpRaft.State() == hashicorpRaft.Leader {
+ ms.Topo.HashicorpRaft.LeadershipTransfer()
+ }
+ })
select {}
}