mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
refactor(socket mount): Update socket mount pattern to `/tmp/seaweedf… (#3662)
This commit is contained in:
parent
b6a1b84a00
commit
19652c1b83
|
@ -295,7 +295,7 @@ func (fo *FilerOptions) startFiler() {
|
||||||
if runtime.GOOS != "windows" {
|
if runtime.GOOS != "windows" {
|
||||||
localSocket := *fo.localSocket
|
localSocket := *fo.localSocket
|
||||||
if localSocket == "" {
|
if localSocket == "" {
|
||||||
localSocket = fmt.Sprintf("/tmp/seaweefs-filer-%d.sock", *fo.port)
|
localSocket = fmt.Sprintf("/tmp/seaweedfs-filer-%d.sock", *fo.port)
|
||||||
}
|
}
|
||||||
if err := os.Remove(localSocket); err != nil && !os.IsNotExist(err) {
|
if err := os.Remove(localSocket); err != nil && !os.IsNotExist(err) {
|
||||||
glog.Fatalf("Failed to remove %s, error: %s", localSocket, err.Error())
|
glog.Fatalf("Failed to remove %s, error: %s", localSocket, err.Error())
|
||||||
|
|
|
@ -107,7 +107,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||||
if mountDirHash < 0 {
|
if mountDirHash < 0 {
|
||||||
mountDirHash = -mountDirHash
|
mountDirHash = -mountDirHash
|
||||||
}
|
}
|
||||||
*option.localSocket = fmt.Sprintf("/tmp/seaweefs-mount-%d.sock", mountDirHash)
|
*option.localSocket = fmt.Sprintf("/tmp/seaweedfs-mount-%d.sock", mountDirHash)
|
||||||
}
|
}
|
||||||
if err := os.Remove(*option.localSocket); err != nil && !os.IsNotExist(err) {
|
if err := os.Remove(*option.localSocket); err != nil && !os.IsNotExist(err) {
|
||||||
glog.Fatalf("Failed to remove %s, error: %s", *option.localSocket, err.Error())
|
glog.Fatalf("Failed to remove %s, error: %s", *option.localSocket, err.Error())
|
||||||
|
|
|
@ -47,7 +47,7 @@ func (c *commandMountConfigure) Do(args []string, commandEnv *CommandEnv, writer
|
||||||
if mountDirHash < 0 {
|
if mountDirHash < 0 {
|
||||||
mountDirHash = -mountDirHash
|
mountDirHash = -mountDirHash
|
||||||
}
|
}
|
||||||
localSocket := fmt.Sprintf("/tmp/seaweefs-mount-%d.sock", mountDirHash)
|
localSocket := fmt.Sprintf("/tmp/seaweedfs-mount-%d.sock", mountDirHash)
|
||||||
|
|
||||||
clientConn, err := grpc.Dial("passthrough:///unix://"+localSocket, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
clientConn, err := grpc.Dial("passthrough:///unix://"+localSocket, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue