Need support with rclone service file

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 :frowning:

I am not able to mount again :confused:

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 :slight_smile:
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?

This is my running 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 \
--allow-other \
--dir-cache-time 48h \
--log-level DEBUG \
--log-file /home/iragoiko/rclone/rclone.log \
--poll-interval 15s \
--umask 002 \
--cache-dir=/home/iragoiko/rclone/cache \
--vfs-cache-mode full \
--vfs-cache-max-size 5G \
--vfs-cache-max-age 48h \
--rc
ExecStop=/bin/fusermount -uz /home/iragoiko/gdrive
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

The problem is that /home/iragoiko/rclone/rclone.log log file keeps increasing. In 2-3 days its size is 25 gb, in one week 50gb....

Is that normal? how can I limit this?

Change that to INFO as you don't need to run normally on debug.

Thanks @Animosity022 . I will modigy and post here the result :slight_smile:

since yesterday the log file size is only 1,5 mb. Looks good :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.