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/cmount: implement --daemon-timeout flag for OSXFUSE

Nick Craig-Wood473e3c3eb8dc
diff --git a/cmd/cmount/mount.go b/cmd/cmount/mount.go
index b40c7c6c6..8bfd13c28 100644
--- a/cmd/cmount/mount.go
+++ b/cmd/cmount/mount.go
@@ -88,6 +88,9 @@ func mountOptions(device string, mountpoint string) (options []string) {
if mountlib.WritebackCache {
// FIXME? options = append(options, "-o", WritebackCache())
}
+ if mountlib.DaemonTimeout != 0 {
+ options = append(options, "-o", fmt.Sprintf("daemon_timeout=%d", int(mountlib.DaemonTimeout.Seconds())))
+ }
for _, option := range mountlib.ExtraOptions {
options = append(options, "-o", option)
}
diff --git a/cmd/mount/mount.go b/cmd/mount/mount.go
index e25799b8f..bbde3076e 100644
--- a/cmd/mount/mount.go
+++ b/cmd/mount/mount.go
@@ -5,6 +5,7 @@
package mount
import (
+ "fmt"
"os"
"os/signal"
"syscall"
@@ -63,6 +64,9 @@ func mountOptions(device string) (options []fuse.MountOption) {
if mountlib.WritebackCache {
options = append(options, fuse.WritebackCache())
}
+ if mountlib.DaemonTimeout != 0 {
+ options = append(options, fuse.DaemonTimeout(fmt.Sprint(int(mountlib.DaemonTimeout.Seconds()))))
+ }
if len(mountlib.ExtraOptions) > 0 {
fs.Errorf(nil, "-o/--option not supported with this FUSE backend")
}
diff --git a/cmd/mountlib/mount.go b/cmd/mountlib/mount.go
index 00fa0c911..5cfd1ec5f 100644
--- a/cmd/mountlib/mount.go
+++ b/cmd/mountlib/mount.go
@@ -31,8 +31,9 @@ var (
ExtraFlags []string
AttrTimeout = 1 * time.Second // how long the kernel caches attribute for
VolumeName string
- NoAppleDouble = true // use noappledouble by default
- NoAppleXattr = false // do not use noapplexattr by default
+ NoAppleDouble = true // use noappledouble by default
+ NoAppleXattr = false // do not use noapplexattr by default
+ DaemonTimeout time.Duration // OSXFUSE only
)
// Check is folder is empty
@@ -274,6 +275,7 @@ be copied to the vfs cache before opening with --vfs-cache-mode full.
flags.StringArrayVarP(flagSet, &ExtraFlags, "fuse-flag", "", []string{}, "Flags or arguments to be passed direct to libfuse/WinFsp. Repeat if required.")
flags.BoolVarP(flagSet, &Daemon, "daemon", "", Daemon, "Run mount as a daemon (background mode).")
flags.StringVarP(flagSet, &VolumeName, "volname", "", VolumeName, "Set the volume name (not supported by all OSes).")
+ flags.DurationVarP(flagSet, &DaemonTimeout, "daemon-timeout", "", DaemonTimeout, "Time limit for rclone to respond to kernel (not supported by all OSes).")
if runtime.GOOS == "darwin" {
flags.BoolVarP(flagSet, &NoAppleDouble, "noappledouble", "", NoAppleDouble, "Sets the OSXFUSE option noappledouble.")