"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
mount,cmount: make sure we call unmount when exiting
Nick Craig-Woodc21a4fee5891
diff --git a/cmd/cmount/mount.go b/cmd/cmount/mount.goindex b11ad16f4..4c11b470d 100644--- a/cmd/cmount/mount.go+++ b/cmd/cmount/mount.go@@ -21,6 +21,7 @@ import ("github.com/pkg/errors""github.com/rclone/rclone/cmd/mountlib""github.com/rclone/rclone/fs"+ "github.com/rclone/rclone/lib/atexit""github.com/rclone/rclone/vfs""github.com/rclone/rclone/vfs/vfsflags")@@ -207,7 +208,7 @@ func mount(f fs.Fs, mountpoint string) (*vfs.VFS, <-chan error, func() error, er// If noModTime is set then itfunc Mount(f fs.Fs, mountpoint string) error {// Mount it- FS, errChan, _, err := mount(f, mountpoint)+ FS, errChan, unmount, err := mount(f, mountpoint)if err != nil {return errors.Wrap(err, "failed to mount FUSE fs")}@@ -217,6 +218,10 @@ func Mount(f fs.Fs, mountpoint string) error {sigHup := make(chan os.Signal, 1)signal.Notify(sigHup, syscall.SIGHUP)+ atexit.Register(func() {+ _ = unmount()+ })+if err := sdnotify.Ready(); err != nil && err != sdnotify.ErrSdNotifyNoSocket {return errors.Wrap(err, "failed to notify systemd")}diff --git a/cmd/mount/mount.go b/cmd/mount/mount.goindex e798e3d28..f464e7047 100644--- a/cmd/mount/mount.go+++ b/cmd/mount/mount.go@@ -137,6 +137,9 @@ func Mount(f fs.Fs, mountpoint string) error {sigHup := make(chan os.Signal, 1)signal.Notify(sigHup, syscall.SIGHUP)atexit.IgnoreSignals()+ atexit.Register(func() {+ _ = unmount()+ })if err := sdnotify.Ready(); err != nil && err != sdnotify.ErrSdNotifyNoSocket {return errors.Wrap(err, "failed to notify systemd")