Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate rclone process #6

Open
sapk opened this issue Sep 8, 2018 · 3 comments
Open

Integrate rclone process #6

sapk opened this issue Sep 8, 2018 · 3 comments

Comments

@sapk
Copy link
Owner

sapk commented Sep 8, 2018

No description provided.

@ivandeex
Copy link

ivandeex commented Nov 8, 2020

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 daemonize after mount rclone/rclone#2968 (comment) 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 Docker leaving zombie processes everytime i mount a vieux/sshfs volume to create a container. vieux/docker-volume-sshfs#78, discussed in docker stop command create <defunct> process trajano/docker-volume-plugins#29 and fixed in FIX #29: use Tini (offiically supported by Docker) to reap defunct glusterfs processes. trajano/docker-volume-plugins#30 (comment) (see the config.json patch....). docker-volume-rclone also needs to incorporate tini in its config to avoid zombies.

@ivandeex
Copy link

ivandeex commented Nov 8, 2020

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

@sapk
Copy link
Owner Author

sapk commented Nov 8, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants