Rclone systemd mount and automount

What is the problem you are having with rclone?

rclone do not detect I'm using a systemd mount and fail to mount via systemd mount/automount.
I'm sad because it's documented but in the forum I find no similar tries, but only people using services :pensive: !
Should I go for a service as anyone else?

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

rclone v1.50.2
- os/arch: linux/amd64
- go version: go1.13.8

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)

This are the units, quite equal to the one find out in the documentation!

# /etc/systemd/system/var-gdrive.mount
[Unit]
After=network-online.target
[Mount]
Type=rclone
What=gdrive:
Where=/var/gdrive
Options=config=/home/postnasal/.config/rclone/rclone.conf,cache-dir=/var/rclone
# /etc/systemd/system/var-gdrive.automount
[Unit]
After=network-online.target
Before=remote-fs.target
[Automount]
Where=/var/gdrive
TimeoutIdleSec=600
[Install]
WantedBy=multi-user.target
~                                                                                                                                                  

The rclone config contents with secrets removed.

[gdrive]
type = drive
client_id = XXXXXXXXXXXXXXXXX
client_secret = XXXXXXXXXXXXXXXXX
scope = drive
root_folder_id = XXXXXXXXXXXXXXXXX
token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2023-03-09T10:25:06.124150624Z"}
team_drive = XXX

A log from the command with the -vv flag

This is the log from journalctl when trying to go inside /var/gdrive:

Mar 09 10:51:52 pnserver systemd[1]: Mounting /var/gdrive...
Mar 09 10:51:52 pnserver mount[551842]: 2023/03/09 10:51:52 ERROR : Couldn't find home directory or read HOME or XDG_CONFIG_HOME environment variables.
Mar 09 10:51:52 pnserver mount[551842]: 2023/03/09 10:51:52 ERROR : Defaulting to storing config in current directory.
Mar 09 10:51:52 pnserver mount[551842]: 2023/03/09 10:51:52 ERROR : Use --config flag to workaround.
Mar 09 10:51:52 pnserver mount[551842]: 2023/03/09 10:51:52 ERROR : Error was: exec: "getent": executable file not found in $PATH
Mar 09 10:51:52 pnserver mount[551842]: Error: unknown command "gdrive:" for "rclone"
Mar 09 10:51:52 pnserver mount[551842]: Run 'rclone --help' for usage.
Mar 09 10:51:52 pnserver mount[551842]: 2023/03/09 10:51:52 Fatal error: unknown command "gdrive:" for "rclone"
Mar 09 10:51:52 pnserver systemd[1]: var-gdrive.mount: Mount process exited, code=exited, status=1/FAILURE
Mar 09 10:51:52 pnserver systemd[1]: var-gdrive.mount: Failed with result 'exit-code'.
Mar 09 10:51:52 pnserver systemd[1]: Failed to mount /var/gdrive.

1 Like

Update to a newer rclone - see the latest release - and try again.

Thanks a lot @ncw , now it works!

1 Like

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