aboutsummaryrefslogtreecommitdiff
path: root/weed/command/mount_std.go
diff options
context:
space:
mode:
authorWeihao Jiang <weihau.chiang@gmail.com>2025-05-23 00:50:07 +0800
committerGitHub <noreply@github.com>2025-05-22 09:50:07 -0700
commit874b4a553594e94b1b21f7f09c1c9a618a3fac78 (patch)
treeb721c2c06d4fdb76ec6ae26ae387671ab72eaab4 /weed/command/mount_std.go
parent165af32d6b738daa14b84fb6e3c8891f4b46135b (diff)
downloadseaweedfs-874b4a553594e94b1b21f7f09c1c9a618a3fac78.tar.xz
seaweedfs-874b4a553594e94b1b21f7f09c1c9a618a3fac78.zip
Ensure `weed fuse` master process exits after mounted (#6809)
* Ensure fuse master process wait for mounted * Validate parent PID input in fuse command
Diffstat (limited to 'weed/command/mount_std.go')
-rw-r--r--weed/command/mount_std.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go
index 631091e80..c419d5697 100644
--- a/weed/command/mount_std.go
+++ b/weed/command/mount_std.go
@@ -13,6 +13,7 @@ import (
"runtime"
"strconv"
"strings"
+ "syscall"
"time"
"github.com/hanwen/go-fuse/v2/fuse"
@@ -268,6 +269,15 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
unmount.Unmount(dir)
})
+ if mountOptions.fuseCommandPid != 0 {
+ // send a signal to the parent process to notify that the mount is ready
+ err = syscall.Kill(mountOptions.fuseCommandPid, syscall.SIGUSR1)
+ if err != nil {
+ fmt.Printf("failed to notify parent process: %v\n", err)
+ return false
+ }
+ }
+
grpcS := pb.NewGrpcServer()
mount_pb.RegisterSeaweedMountServer(grpcS, seaweedFileSystem)
reflection.Register(grpcS)