I have rcline set up as a system service, and plex in a docker. When I reboot, my plex docker loads before my drive mounts, so everything shows unavailable. Restarting plex fixes it, but is kind of a pain.
Wondering if anyone else found this, and has any solution?
What is your rclone version (output from rclone version)
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Which cloud storage system are you using? (eg Google Drive)
The command you were trying to run (eg rclone copy /tmp remote:tmp)
Hi filthyrich, so currently I run both Plex and Rclone in Docker containers as well as a number of other pieces of software that utilise the mount, such as Radarr, Sonarr, Syncthing, Mylar and Calibre etc.
With this setup I am able to use bind propagation to set my rclone mount as shared and my Plex install as a slave. I believe this would solve your problem if you were happy to put your Plex install into a docker container.
In addition as none of this software is creating directories on the mount that shouldn't already be there I am using the --allow-non-empty command in my mount script. I understand this is frowned upon in general as it will overwrite anything in it's way, however in my case this is irrelevant as the directories that are getting created before the mount aren't supposed to exist outside of the mount. This means that if Plex or any other piece of software that is dependant on the mount being available first, does create a directory too quickly it is replaced by the correct directory when the Rclone mount is ready. For my set up I have found it necessary as both Syncthing and Calibre are creating directories they expect to find instead of waiting for the mount to create them.
Please the note the above is generally not advised as you are giving the rclone mount permission to overwrite anything in its way, therefore this introduces a risk of data loss, so I wouldn't use this unless absolutely necessary.
Happy to share my scripts if you are interested? I appreciate there are many ways to skin the proverbial cat however and I'm sure others will jump in with alternative suggestions to get your setup working.
So first off I don't personally use Compose for my docker setup. Although it would make my life easier, I've just not gotten around to setting it all up as I have 16 containers and it will take me a while, so my scripts are just basic docker commands. No reason you can't easily adapt them for compose though.
So here is my rclone script (This is the official rclone container)
As you can see it is also set up for webgui access, hence the port number but you may not want or need that. The important point to note is the volume I have added -v /mnt:/mnt:shared It is essential you add the shared command to whatever location you plan to add your mount to, not the mount itself. So in my case, as mnt/Skull is the location of my rclone mount I need to add the shared command to mnt
as you can see I have added a volume for my mount -v /mnt/Skull:/mnt/Skull:rslave that uses the rslave command to bind itself to the mount.
Without going into great detail on bind propagation this means you are able to start Plex before the mount without issue, as Plex will see the mount once it's ready, without having to restart it.
I must just stress that the command I have in my rclone script --allow-non-empty shouldn't be used for the sake of it as it can be destructive. I am using is in my set up as I have a couple of containers that create empty directories in anticipation of where the mount should be. I have tested this in my set up and know that it does no harm, however it should be used with great caution as it gives the mount permission to write straight over the top of whatever is underneath!
I use fstab to mount all rclone / mergerfs / cifs in the host OS. Some of these mounts are made available to the docker containers.
The issue I face is during power off/on/reboot. Docker starts before all mounts are ready.
So, in my case, I need to restart a container about a minute after the host OS has completed the boot process.
It's not elegant or very resilient, but it works.
My entry for this in crontab looks like this: @reboot echo docker restart container_name | sudo at now + 1 minutes
This configuration depends on the at service which needs to be installed and enabled at boot.