docker-volume-rclone icon indicating copy to clipboard operation
docker-volume-rclone copied to clipboard

Integrate rclone process

Open sapk opened this issue 5 years ago • 3 comments

sapk avatar Sep 08 '18 09:09 sapk

Three notes on rclone integration:

  1. mount Currently when docker-volume-rclone starts an rclone mount it has to manually check.... that the mount has been successful. In the next release (v1.54 or v1.55) rclone mount --daemon remote: /mnt/path will natively fork and internally perform a check similar to isMounted().... and return exit code 1 if it fails (see https://github.com/rclone/rclone/issues/2968#issuecomment-716679470 and below). That change is currently being planned.

  2. unmount The rclone background process will stop a mount on one of two conditions: signal 15 (requires pid, not used here) or external unmount, so that docker-volume-rclone's method.... continues to work. Just a note: it uses root-only umount while fusermount -u could be run by a non-root user that made a mount (with fallback to umount if package fuse is not installed). Also, both umount and fusermount -u will fail if a process keeps using the directory mounted. To be more robust, docker-volume-rclone could fallback to umount -l or fusermount -u -l after a timeout to avoid cascading deadlocks in docker applications.

  3. zombies After unmount the rclone background process should be normally reaped by systemd but in a docker container this is not done by default. This issue was mentioned in https://github.com/vieux/docker-volume-sshfs/issues/78, discussed in https://github.com/trajano/docker-volume-plugins/issues/29 and fixed in https://github.com/trajano/docker-volume-plugins/pull/30#issuecomment-700856794 (see the config.json patch....). docker-volume-rclone also needs to incorporate tini in its config to avoid zombies.

ivandeex avatar Nov 08 '20 15:11 ivandeex

While embedding rclone as a library is out of scope of this issue, FYI there is a ticket https://github.com/rclone/rclone/issues/633 to implement support for that in future.

ivandeex avatar Nov 08 '20 16:11 ivandeex

I think it should be fairly possible to add a rclone serve docker command exposing a docker volume api if allowed by rclone maintainers.

sapk avatar Nov 08 '20 16:11 sapk