1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-07-06 00:57:10 +02:00

return meaningful error log

This commit is contained in:
Chris Lu 2019-12-10 21:44:00 -08:00
parent 3727d2488f
commit 5847c5afff

View file

@ -12,14 +12,15 @@ import (
"strings" "strings"
"time" "time"
"github.com/jacobsa/daemonize"
"github.com/spf13/viper"
"github.com/chrislusf/seaweedfs/weed/filesys" "github.com/chrislusf/seaweedfs/weed/filesys"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/security" "github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"github.com/jacobsa/daemonize"
"github.com/seaweedfs/fuse" "github.com/seaweedfs/fuse"
"github.com/seaweedfs/fuse/fs" "github.com/seaweedfs/fuse/fs"
"github.com/spf13/viper"
) )
func runMount(cmd *Command, args []string) bool { func runMount(cmd *Command, args []string) bool {
@ -121,9 +122,9 @@ func RunMount(filer, filerMountRootPath, dir, collection, replication, dataCente
c, err := fuse.Mount(dir, options...) c, err := fuse.Mount(dir, options...)
if err != nil { if err != nil {
glog.Fatal(err) glog.V(0).Infof("mount: %v", err)
daemonize.SignalOutcome(err) daemonize.SignalOutcome(err)
return false return true
} }
util.OnInterrupt(func() { util.OnInterrupt(func() {
@ -133,9 +134,9 @@ func RunMount(filer, filerMountRootPath, dir, collection, replication, dataCente
filerGrpcAddress, err := parseFilerGrpcAddress(filer) filerGrpcAddress, err := parseFilerGrpcAddress(filer)
if err != nil { if err != nil {
glog.Fatal(err) glog.V(0).Infof("parseFilerGrpcAddress: %v", err)
daemonize.SignalOutcome(err) daemonize.SignalOutcome(err)
return false return true
} }
mountRoot := filerMountRootPath mountRoot := filerMountRootPath
@ -170,8 +171,9 @@ func RunMount(filer, filerMountRootPath, dir, collection, replication, dataCente
// check if the mount process has an error to report // check if the mount process has an error to report
<-c.Ready <-c.Ready
if err := c.MountError; err != nil { if err := c.MountError; err != nil {
glog.Fatal(err) glog.V(0).Infof("mount process: %v", err)
daemonize.SignalOutcome(err) daemonize.SignalOutcome(err)
return true
} }
return true return true