Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

mount: fix macOS not noticing errors with --daemon

Nick Craig-Wood9bfbf2a4ae58
diff --git a/cmd/mountlib/mount.go b/cmd/mountlib/mount.go
index 4bc9e066a..558a7b241 100644
--- a/cmd/mountlib/mount.go
+++ b/cmd/mountlib/mount.go
@@ -10,6 +10,7 @@ import (
"runtime"
"strings"
"sync"
+ "syscall"
"time"
"github.com/rclone/rclone/cmd"
@@ -222,6 +223,13 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm
err = WaitMountReady(mnt.MountPoint, Opt.DaemonWait)
if err != nil {
killDaemon("Daemon timed out")
+ } else {
+ // Double check daemon is still alive
+ // on non Linux OSes WaitMountReady is just a no-op
+ err = daemon.Signal(syscall.Signal(0))
+ if err != nil {
+ err = fmt.Errorf("daemon has died: %w", err)
+ }
}
atexit.Unregister(handle)
}