What is the problem you are having with rclone?
My rclone systemctl unit works if I start it manually but doesn't come up at boot.
What is your rclone version (output from rclone version
)
$ rclone --version
rclone v1.55.1
- os/type: linux
- os/arch: amd64
- go/version: go1.16.3
- go/linking: static
- go/tags: none
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Ubuntu 20.10
Which cloud storage system are you using? (eg Google Drive)
MS OneDrive
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone mount
(via systemctl, see below)
The rclone config contents with secrets removed.
[onedrive]
type = onedrive
region = global
token = REDACTED
drive_id = REDACTED
drive_type = business
A log from the command with the -vv
flag
There's nothing in the log file since the last reboot
More info
I've installed the unit in --user
mode with
systemctl --user enable rclone.service
systemctl --user start rclone.service
After reboot, it's inactive (dead)
:
$ systemctl --user status rclone.service
● rclone.service - RClone Service
Loaded: loaded (/etc/xdg/systemd/user/rclone.service; enabled; vend>
Active: inactive (dead)
Here's the unit file:
$ systemctl --user cat rclone.service
# /etc/xdg/systemd/user/rclone.service
[Unit]
Description=RClone Service
Wants=network-online.target
After=network-online.target
[Service]
Type=notify
Restart=on-abort
RestartSec=5
KillMode=none
ExecStart=/usr/bin/rclone \
mount onedrive: \
/mnt/onedrive \
--config /home/tom/.config/rclone/rclone.conf \
--log-file /var/log/rclone/rclone.log \
--log-level INFO \
--vfs-cache-mode full \
--cache-dir /home/tom/.cache/rclone/onedrive
ExecStop=/bin/fusermount -u -z \
/mnt/onedrive
[Install]
WantedBy=multi-user.target
There's nothing in the log file since the last reboot. network-online.target
is active:
$ systemctl status network-online.target
● network-online.target - Network is Online
Loaded: loaded (/lib/systemd/system/network-online.target; static)
Active: active since Wed 2021-06-02 08:33:02 AEST; 1h 41min ago
Docs: man:systemd.special(7)
https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
Jun 02 08:33:02 tom systemd[1]: Reached target Network is Online.
And running systemctl --user start rclone.service
brings the mount up.
There's a similar closed issue called "Systemctl service starts manually, but not on boot" (seems I'm not permitted to link to it, sorry). The fix in that thread was to disable and re-enable the service, which I've tried. The problem still exists after reboot.
There are some other systemd issues on the forum that seem to have been caused by windows line endings. That's not the case here, I wrote the file on a linux machine and checked the encoding.
I would appreciate any further suggestions because I'm not sure how to troubleshoot this. In particular I'm not sure if these lines are correct:
Type=notify
Restart=on-abort
KillMode=none
Thanks for reading!