What is the problem you are having with rclone?
I am attempting to have rclone automatically map an Azure blob storage location at boot using a systemd service (config below). It fails to run, and give an error about not finding the cache file:
#### Run the command 'rclone version' and share the full output of the command.
root@wmssfs00:~# rclone version
rclone v1.68.2
- os/version: debian 11.11 (64 bit)
- os/kernel: 5.10.0-33-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.23.3
- go/linking: static
- go/tags: none
root@wmssfs00:~#
Current version is showing as 1.68.2 at https://rclone.org/download
#### Which cloud storage system are you using? (eg Google Drive)
Microsoft Azure Blob Storage
#### The command you were trying to run (eg `rclone copy /tmp remote:tmp`)
<!-- You should use 3 backticks to begin and end your paste to make it readable. -->
systemctl start rclone
The rclone.service file (in /etc/systemd/system/ contains the following:
/etc/systemd/system/rclone.service
[Unit]
Description=Auto Mount MASD Azure Blob
Wants=network-online.target
After=network-online.target
[Service]
Type=idle
ExecStart=/usr/bin/rclone mount
--config /etc/default/rclone/rclone.conf
--log-file /var/log/rclone.log
--log-level DEBUG
--allow-non-empty
--allow-other
--cache-dir /var/cache/rclone
MASD_Azure:/ /var/backups/rclone
--daemon
ExecStop=/usr/bin/fusermount -u /var/backups/rclone
[Install]
WantedBy=multi-user.target
#### Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.
<!-- You should use 3 backticks to begin and end your paste to make it readable. -->
[MASD_Azure]
type = azureblob
account = XXX
key = XXX
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
<!-- You should use 3 backticks to begin and end your paste to make it readable. Or use a service such as https://pastebin.com or https://gist.github.com/ -->
From the rclone.log when attempting to start rclone.service:
2024/11/28 16:41:13 DEBUG : rclone: Version "v1.68.2" starting with parameters ["/usr/bin/rclone" "mount" "--config" "/etc/default/rclone/rclone.conf" "--log-file" "/var/log/rclone.log" "--log-level" "DEBUG" "--allow-non-empty" "--allow-other" "--cache-dir" "/var/cache/rclone" "MASD_Azure:/" "/var/backups/rclone" "--daemon"]
2024/11/28 16:41:13 DEBUG : Creating backend with remote "MASD_Azure:/"
2024/11/28 16:41:13 DEBUG : Using config file from "/etc/default/rclone/rclone.conf"
2024/11/28 16:41:13 DEBUG : fs cache: renaming cache item "MASD_Azure:/" to be canonical "MASD_Azure:"
2024/11/28 16:41:13 DEBUG : rclone: Version "v1.68.2" finishing with parameters ["/usr/bin/rclone" "mount" "--config" "/etc/default/rclone/rclone.conf" "--log-file" "/var/log/rclone.log" "--log-level" "DEBUG" "--allow-non-empty" "--allow-other" "--cache-dir" "/var/cache/rclone" "MASD_Azure:/" "/var/backups/rclone" "--daemon"]
The rclone.service shows an error when checked, and the location is not mounted:
root@wmssfs00:/var/log# systemctl status rclone
● rclone.service - Auto Mount MASD Azure Blob
Loaded: loaded (/etc/systemd/system/rclone.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Nov 28 13:28:21 wmssfs00 systemd[1]: rclone.service: Control process exited, code=exited, status=1/FAILURE
Nov 28 13:28:21 wmssfs00 systemd[1]: rclone.service: Failed with result 'exit-code'.
Nov 28 13:37:05 wmssfs00 systemd[1]: Started Auto Mount MASD Azure Blob.
Nov 28 13:37:05 wmssfs00 rclone[1566132]: 2024/11/28 13:37:05 DEBUG : Failed to find user cache dir, using temporary directory: neither $XDG_CACHE_>
Nov 28 13:37:05 wmssfs00 fusermount[1566153]: /usr/bin/fusermount: failed to unmount /var/backups/rclone: Device or resource busy
Nov 28 13:37:05 wmssfs00 systemd[1]: rclone.service: Control process exited, code=exited, status=1/FAILURE
Nov 28 13:37:05 wmssfs00 systemd[1]: rclone.service: Failed with result 'exit-code'.
Nov 28 16:41:13 wmssfs00 systemd[1]: Started Auto Mount MASD Azure Blob.
Nov 28 16:41:13 wmssfs00 rclone[1624009]: 2024/11/28 16:41:13 DEBUG : Failed to find user cache dir, using temporary directory: neither $XDG_CACHE_>
Nov 28 16:41:13 wmssfs00 systemd[1]: rclone.service: Succeeded.
root@wmssfs00:/var/log#
Note that I am specifying /var/cache/rclone as the cache location. This location does exist:
root@wmssfs00:/var/cache# ls | grep rclone
drwxr-xr-x 2 root root 4096 Nov 28 12:55 rclone
root@wmssfs00:/var/cache# cd rclone
root@wmssfs00:/var/cache/rclone# pwd
/var/cache/rclone
root@wmssfs00:/var/cache/rclone#
If I run the command manually:
root@wmssfs00:/etc/systemd/system# /usr/bin/rclone mount --config /etc/default/rclone/rclone.conf --log-file /var/log/rclone.log --log-level DEBUG --allow-non-empty --allow-other --cache-dir /var/cache/rclone MASD_Azure:/ /var/backups/rclone --daemon -vv
root@wmssfs00:/etc/systemd/system#
This is the result in the log file (it errored with the -vv so I dropped it)
2024/11/28 19:15:43 CRITICAL: Can't set -v and --log-level
2024/11/28 19:15:59 DEBUG : rclone: Version "v1.68.2" starting with parameters ["/usr/bin/rclone" "mount" "--config" "/etc/default/rclone/rclone.conf" "--log-file" "/var/log/rclone.log" "--log-level" "DEBUG" "--allow-non-empty" "--allow-other" "--cache-dir" "/var/cache/rclone" "MASD_Azure:/" "/var/backups/rclone" "--daemon"]
2024/11/28 19:15:59 DEBUG : Creating backend with remote "MASD_Azure:/"
2024/11/28 19:15:59 DEBUG : Using config file from "/etc/default/rclone/rclone.conf"
2024/11/28 19:15:59 DEBUG : fs cache: renaming cache item "MASD_Azure:/" to be canonical "MASD_Azure:"
2024/11/28 19:15:59 DEBUG : rclone: Version "v1.68.2" starting with parameters ["/usr/bin/rclone" "mount" "--config" "/etc/default/rclone/rclone.conf" "--log-file" "/var/log/rclone.log" "--log-level" "DEBUG" "--allow-non-empty" "--allow-other" "--cache-dir" "/var/cache/rclone" "MASD_Azure:/" "/var/backups/rclone" "--daemon"]
2024/11/28 19:15:59 DEBUG : Creating backend with remote "MASD_Azure:/"
2024/11/28 19:15:59 DEBUG : Using config file from "/etc/default/rclone/rclone.conf"
2024/11/28 19:15:59 DEBUG : fs cache: renaming cache item "MASD_Azure:/" to be canonical "MASD_Azure:"
2024/11/28 19:15:59 INFO : Azure root: poll-interval is not supported by this remote
2024/11/28 19:15:59 DEBUG : Azure root: Mounting on "/var/backups/rclone"
2024/11/28 19:15:59 DEBUG : : Root:
2024/11/28 19:15:59 DEBUG : : >Root: node=/, err=<nil>
2024/11/28 19:15:59 DEBUG : rclone: Version "v1.68.2" finishing with parameters ["/usr/bin/rclone" "mount" "--config" "/etc/default/rclone/rclone.conf" "--log-file" "/var/log/rclone.log" "--log-level" "DEBUG" "--allow-non-empty" "--allow-other" "--cache-dir" "/var/cache/rclone" "MASD_Azure:/" "/var/backups/rclone" "--daemon"]
It is running and the blob is mounted:
root@wmssfs00:/var/log# ps aux | grep rclone
root 1672297 0.0 0.0 1289392 52268 pts/1 Sl 19:15 0:00 /usr/bin/rclone mount --config /etc/default/rclone/rclone.conf --log-file /var/log/rclone.log --log-level DEBUG --allow-non-empty --allow-other --cache-dir /var/cache/rclone MASD_Azure:/ /var/backups/rclone --daemon
root 1672943 0.0 0.0 6240 648 pts/1 S+ 19:17 0:00 grep -i --color=auto rclone
root@wmssfs00:/var/log# rclone ls /var/backups/rclone
0 data/testing.txt
73 data/wmssfs00/README
964 data/wmssfs00/config
52 data/wmssfs00/hints.1
41258 data/wmssfs00/index.1
190 data/wmssfs00/integrity.1
16 data/wmssfs00/nonce
530 data/wmssfs00/data/0/0
17 data/wmssfs00/data/0/1
root@wmssfs00:/var/log#
I have searched multiple times, this matches some of the systemd configurations I found to run rclone as a service (other configurations are to configure it as a mount for automount to grab, not running as a service).
I have tried multiple iterations to get this to function, including putting the entire command on a single line in the rclone.service file, with no change. It keeps complaining about the cache file and temp. Looking for that particular error gives me nothing related, I found some hits relating to Google drive, but the requirements appear to be different than the Azure blob we have.
If I can provide any additional information, let me know what.
Thanks!