Mount via systemd

STOP and READ USE THIS TEMPLATE NO EXCEPTIONS - By not using this, you waste your time, our time and really hate puppies. Please remove these two lines and that will confirm you have read them.

What is the problem you are having with rclone?

I'm trying to mount a google-drive with systemd. When I try by hand this command works and the drive is mounted:
/usr/bin/rclone mount --poll-interval 10s --cache-dir=/opt/rclone-cache/google-drive --vfs-cache-mode full drive: /mnt/google-drive -vv

When wrapping it on a systemd service, the drive is not properly mounted:

[ws20lnx] /mnt: ll
ls: cannot access 'google-drive': Permission denied
total 0
d????????? ? ? ? ?            ? google-drive

My systemd configuration file is:

[Unit]
Description=Google Drive via rclone
Wants=network-online.target
After=network-online.target
AssertPathIsDirectory=/mnt/google-drive

[Service]
Type=notify
Environment=RCLONE_CONFIG=/home/whatsthecraic/.config/rclone/rclone.conf 
RestartSec=10
ExecStart=/usr/bin/rclone mount --poll-interval 10s --cache-dir=/opt/rclone-cache/google-drive --vfs-cache-mode full drive: /mnt/google-drive -vv

ExecStop=/bin/fusermount -uz /mnt/google-drive
Restart=on-failure
User=whatsthecraic
Group=whatsthecraic

[Install]
WantedBy=multi-user.target

Run the command 'rclone version' and share the full output of the command.

rclone v1.67.0

  • os/version: arch (64 bit)
  • os/kernel: 6.10.8-arch1-1 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.22.5
  • go/linking: dynamic
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

/usr/bin/rclone mount --poll-interval 10s --cache-dir=/opt/rclone-cache/google-drive --vfs-cache-mode full drive: /mnt/google-drive -vv

wrapped in a systemd configuration (see above)

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[ws20lnx] /mnt: rclone config redacted
[drive]
type = drive
scope = drive
token = XXX
team_drive = 
### Double check the config for sensitive info before posting publicly

A log from the command that you were trying to run with the -vv flag

This is the log from systemd:

Sep 09 18:39:39 ws20lnx systemd[1]: Starting Google Drive via rclone...
Sep 09 18:39:39 ws20lnx rclone[10211]: 2024/09/09 18:39:39 DEBUG : Setting --config "/home/whatsthecraic/.config/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/home/whatsthecraic/.config/rclon>
Sep 09 18:39:39 ws20lnx rclone[10211]: DEBUG : rclone: Version "v1.67.0" starting with parameters ["/usr/bin/rclone" "mount" "--poll-interval" "10s" "--cache-dir=/opt/rclone-cache/google-dr>
Sep 09 18:39:39 ws20lnx rclone[10211]: DEBUG : rclone: systemd logging support activated
Sep 09 18:39:39 ws20lnx rclone[10211]: DEBUG : Creating backend with remote "drive:"
Sep 09 18:39:39 ws20lnx rclone[10211]: DEBUG : Using config file from "/home/whatsthecraic/.config/rclone/rclone.conf"
Sep 09 18:39:40 ws20lnx rclone[10211]: DEBUG : Google drive root '': 'root_folder_id = 0AEL-qV0evQopUk9PVA' - save this in the config to speed up startup
Sep 09 18:39:40 ws20lnx rclone[10211]: DEBUG : vfs cache: root is "/opt/rclone-cache/google-drive"
Sep 09 18:39:40 ws20lnx rclone[10211]: DEBUG : vfs cache: data root is "/opt/rclone-cache/google-drive/vfs/drive"
Sep 09 18:39:40 ws20lnx rclone[10211]: DEBUG : vfs cache: metadata root is "/opt/rclone-cache/google-drive/vfsMeta/drive"
Sep 09 18:39:40 ws20lnx rclone[10211]: DEBUG : Creating backend with remote "/opt/rclone-cache/google-drive/vfs/drive/"
Sep 09 18:39:40 ws20lnx rclone[10211]: DEBUG : fs cache: renaming cache item "/opt/rclone-cache/google-drive/vfs/drive/" to be canonical "/opt/rclone-cache/google-drive/vfs/drive"
Sep 09 18:39:40 ws20lnx rclone[10211]: DEBUG : Creating backend with remote "/opt/rclone-cache/google-drive/vfsMeta/drive/"
Sep 09 18:39:40 ws20lnx rclone[10211]: DEBUG : fs cache: renaming cache item "/opt/rclone-cache/google-drive/vfsMeta/drive/" to be canonical "/opt/rclone-cache/google-drive/vfsMeta/drive"
Sep 09 18:39:40 ws20lnx rclone[10211]: INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
Sep 09 18:39:40 ws20lnx rclone[10211]: DEBUG : Google drive root '': Mounting on "/mnt/google-drive"
Sep 09 18:39:40 ws20lnx rclone[10211]: DEBUG : : Root:
Sep 09 18:39:40 ws20lnx rclone[10211]: DEBUG : : >Root: node=/, err=<nil>
Sep 09 18:39:40 ws20lnx systemd[1]: Started Google Drive via rclone.
Sep 09 18:39:50 ws20lnx rclone[10211]: DEBUG : Google drive root '': Checking for changes on remote
Sep 09 18:40:00 ws20lnx rclone[10211]: DEBUG : Google drive root '': Checking for changes on remote
Sep 09 18:40:10 ws20lnx rclone[10211]: DEBUG : Google drive root '': Checking for changes on remote
Sep 09 18:40:20 ws20lnx rclone[10211]: DEBUG : Google drive root '': Checking for changes on remote
Sep 09 18:40:20 ws20lnx rclone[10211]: DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: Quota exceeded for quota metric 'Queries' and limit 'Queries per minute' of service '>
Sep 09 18:40:20 ws20lnx rclone[10211]: Details:
Sep 09 18:40:20 ws20lnx rclone[10211]: [
Sep 09 18:40:20 ws20lnx rclone[10211]:   {
Sep 09 18:40:20 ws20lnx rclone[10211]:     "@type": "type.googleapis.com/google.rpc.ErrorInfo",
Sep 09 18:40:20 ws20lnx rclone[10211]:     "domain": "googleapis.com",
Sep 09 18:40:20 ws20lnx rclone[10211]:     "metadata": {
Sep 09 18:40:20 ws20lnx rclone[10211]:       "consumer": "projects/202264815644",
Sep 09 18:40:20 ws20lnx rclone[10211]:       "quota_limit": "defaultPerMinutePerProject",
Sep 09 18:40:20 ws20lnx rclone[10211]:       "quota_limit_value": "420000",
Sep 09 18:40:20 ws20lnx rclone[10211]:       "quota_location": "global",
Sep 09 18:40:20 ws20lnx rclone[10211]:       "quota_metric": "drive.googleapis.com/default",
Sep 09 18:40:20 ws20lnx rclone[10211]:       "service": "drive.googleapis.com"
Sep 09 18:40:20 ws20lnx rclone[10211]:     },
Sep 09 18:40:20 ws20lnx rclone[10211]:     "reason": "RATE_LIMIT_EXCEEDED"
Sep 09 18:40:20 ws20lnx rclone[10211]:   },
...

welcome to the forum,

try adding --allow-other

need to create your own client_id
Making your own client_id

1 Like

thank you! This resolved the issue. I had to enable user_allow_other in /etc/fuse.conf (this was mentioned in the error message when attempting to use --allow-other)

Out of curiosity: I have a laptop where the same configuration works for systemd without the option --allow-other. Any idea why this is the case?

1 Like

welcome

well, no idea. something must be not the same ?

Are you maybe using the same user to run systemd service as you use to access mount point? One or another way it is permissions problem I am sure if you investigate in details you will find out the answer.

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