i think the problem about that folder.
then when docker starts it is complaing that it cannot create that folder
I am not sure of that. Docker does not create any folder, just mount that directory to its needs.
Also when I mount using sudo service rclone start then I had no issue when starting my docker.
Somehow this service is blocking access to docker users
under what user is the docker instance running?
in the service file there is this, maybe remove or change it?
User=iragoiko
Group=iragoiko
when I remove user and group from service file, I can run container without problem. But I can not play mounted directory content.
Can I refer to multiple user and grops to allow working at this mounting directory?
--allow-other \ is not supposed to give permision to acces to the mount to other user and groups?
look at gdrive mounted directory
root@debian:/home/iragoiko# ls -la
total 76
drwxr-xr-x 11 iragoiko iragoiko 4096 oct 25 18:34 .
drwxr-xr-x 4 root root 4096 oct 20 08:07 ..
-rw------- 1 iragoiko iragoiko 10316 oct 25 19:23 .bash_history
-rw-r--r-- 1 iragoiko iragoiko 220 oct 20 08:07 .bash_logout
-rw-r--r-- 1 iragoiko iragoiko 3526 oct 20 08:07 .bashrc
drwxr-xr-x 3 iragoiko iragoiko 4096 oct 20 08:31 .cache
drwxr-xr-x 3 iragoiko iragoiko 4096 oct 20 08:31 .config
drwxr-xr-x 5 iragoiko iragoiko 4096 oct 20 10:25 config
drwxr-xr-x 2 iragoiko iragoiko 4096 oct 20 08:31 emby
drwxr-xr-x 1 root root 0 oct 25 19:24 gdrive
drwx------ 3 iragoiko iragoiko 4096 oct 20 08:25 .gnupg
drwxr-xr-x 3 iragoiko iragoiko 4096 oct 21 22:55 .local
drwxr-xr-x 3 iragoiko iragoiko 4096 oct 21 19:09 plex
-rw-r--r-- 1 iragoiko iragoiko 807 oct 20 08:07 .profile
drwxr-xr-x 2 iragoiko iragoiko 4096 oct 25 17:23 rclone
-rw-r----- 1 iragoiko iragoiko 140 oct 25 18:34 rclone.log
-rw------- 1 iragoiko iragoiko 8052 oct 21 18:03 .viminfo
Something should be wrong right?
the gdrive mounted folder is /home/iragoiko/gdrive
I run docker as iragoiko. Even if I am member of sudo, iragoiko, docker
I think the best will be that mount directory belongs to iragoiko
What is the function of the flag -allow-other?
This is a permision issue which I am not able to sort out with the service file...
If I run service as iragoiko with "sudo service rclone start" it works fine
If I run mount command as iragoiko also works fine.
But with the service with systemctl no way
I am not able to mount again
Service file:
[Unit]
Description=RClone Service
Wants=network-online.target
After=network-online.target
[Service]
Type=notify
Environment=RCLONE_CONFIG=/home/iragoiko/.config/rclone/rclone.conf
KillMode=none
ExecStartPre=/bin/sleep 5
ExecStart=/usr/bin/rclone mount gdrive: /home/iragoiko/gdrive
# This is for allowing users other than the user running rclone access to the mount
--allow-other \
# Google Drive is a polling remote so this value can be set very high and any changes are detected via polling.
--dir-cache-time 96h \
# The log level output
--log-level DEBUG \
# Location of the log file
--log-file /home/iragoiko/rclone/rclone.log \
# I reduce the poll interval down to 15 seconds as this makes changes appear fast the API quotas per day are huge
--poll-interval 15s \
# This is setting the file permission on the mount to user and group have the same access and other can read
--umask 002 \
# The local disk used for caching
--cache-dir=/cache \
# This is used for caching files to local disk for streaming
--vfs-cache-mode full \
# This limits the cache size to the value below
--vfs-cache-max-size 30G \
# This limits the age in the cache if the size is reached and it removes the oldest files first
--vfs-cache-max-age 336h \
# This sets up the remote control daemon so you can issue rc commands locally
--rc
ExecStop=/bin/fusermount -uz /home/iragoiko/gdrive
Restart=on-failure
RestartSec=5
User=iragoiko
Group=iragoiko
[Install]
WantedBy=multi-user.target
Status log
iragoiko@debian:~$ sudo systemctl status rclone.service
● rclone.service - RClone Service
Loaded: loaded (/etc/systemd/system/rclone.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2020-10-25 21:59:23 CET; 479ms ago
Process: 4806 ExecStartPre=/bin/sleep 5 (code=exited, status=0/SUCCESS)
Process: 4809 ExecStart=/usr/bin/rclone mount gdrive: /home/iragoiko/gdrive (code=exited, status=1/FAILURE)
Main PID: 4809 (code=exited, status=1/FAILURE)
i think you need to add a trailing slash
[Unit]
Description=RClone Service
Wants=network-online.target
After=network-online.target
[Service]
Type=notify
Environment=RCLONE_CONFIG=/home/iragoiko/.config/rclone/rclone.conf
KillMode=none
ExecStartPre=/bin/sleep 5
ExecStart=/usr/bin/rclone mount gdrive: /home/iragoiko/gdrive \
# This is for allowing users other than the user running rclone access to the mount
--allow-other \
# Google Drive is a polling remote so this value can be set very high and any changes are detected via polling.
--dir-cache-time 96h \
# The log level output
--log-level DEBUG \
# Location of the log file
--log-file /home/iragoiko/rclone/rclone.log \
# I reduce the poll interval down to 15 seconds as this makes changes appear fast the API quotas per day are huge
--poll-interval 15s \
# This is setting the file permission on the mount to user and group have the same access and other can read
--umask 002 \
# The local disk used for caching
--cache-dir=/cache \
# This is used for caching files to local disk for streaming
--vfs-cache-mode full \
# This limits the cache size to the value below
--vfs-cache-max-size 30G \
# This limits the age in the cache if the size is reached and it removes the oldest files first
--vfs-cache-max-age 336h \
# This sets up the remote control daemon so you can issue rc commands locally
--rc
ExecStop=/bin/fusermount -uz /home/iragoiko/gdrive
Restart=on-failure
RestartSec=5
User=iragoiko
Group=iragoiko
[Install]
WantedBy=multi-user.target
Not working yet
If I move the service file from /etc/systemd/system
to => /home/iragoiko/.config/systemd/system
should be OK? is that the correct path for user service file?
The official wiki defines these paths which I think they are not correct. I do not see any example of rclone service installed in the following paths as defined wiki.
/etc/systemd/user/rclone@.service
or ~/.config/systemd/user/rclone@.service
Wiki is correct?
Maybe completely off the mark here, but do have user_allow_other
in your fuse.conf file?
the conf file is usually in /etc/fuse.conf
Thanks for your answer. user_allow_other
was already active on fuse.conf
# /etc/fuse.conf - Configuration file for Filesystem in Userspace (FUSE)
# Set the maximum number of FUSE mounts allowed to non-root users.
# The default is 1000.
#mount_max = 1000
# Allow non-root users to specify the allow_other or allow_root mount options.
user_allow_other
if I put rclone.service file in /home/iragoiko/.config/systemd/system
systemctl command can not find:
Failed to enable unit: Unit file rclone.service does not exist.
The wiki information is not correct.
i agree this is confusing.
wiki -> /etc/systemd/user
@Animosity022 -> not clear exactly where to place the rclone.service file?
I don't use dockers myself as my main gripe is that add complexity and little value for this type of setup.
I use systemd as a system file and it's in /etc/systemd/system
If you use it as a user, you can place it in a bunch of spots.
-
/usr/lib/systemd/user/
where units provided by installed packages belong. -
~/.local/share/systemd/user/
where units of packages that have been installed in the home directory belong. -
/etc/systemd/user/
where system-wide user units are placed by the system administrator. -
~/.config/systemd/user/
where the user puts their own units.
So it depends on your level of access to the server.
finally found the mistake. I have to be able to run everything as iragoiko (rclone config, docker all is as iragoiko) and did not have permisions to rclone service /cache directory as iragoiko. I moved cache to to /home/iragoiko/... and now service is working fine.
Now i have to delay my docker service or container startup.
Thanks for your support @asdffdsa
good, we are both learning from our own mistakes, step by step
Yes, at least I do
Do you think it will be possible to mount SAMBA share with this rclone mount at fstab?
i have shared a rclone mount over samba
you can read about it here
*Solved* Is it possible to access my Rclone mount as a Samba share?