Running `rclone serve restic` as systemd service stopped working

What is the problem you are having with rclone?

Running rclone serve restic as a systemd service stopped working with v1.70.0. v1.70.1 does not fix the issue.

I'm succesfully using rclone v1.69.3 as a systemd-socket activated service (Type=notify) for rclone serve restic. The setup stopped working with v1.70.0. Simplifying the service by removing socket activation, setting Type=simple, removing tls+authentication and switching to :memory: backend doesn't change anything.

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

rclone v1.70.1
- os/version: debian 12.11 (64 bit)
- os/kernel: 6.1.0-35-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.24.4
- go/linking: static
- go/tags: none

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

Irrelevant. Replicate with memory.

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

Running in shell works:

root@charon:~# /usr/local/bin/rclone_v1.70.1-linux-amd64 -vvv serve restic :memory:
2025/06/19 16:21:07 DEBUG : rclone: Version "v1.70.1" starting with parameters ["/usr/local/bin/rclone_v1.70.1-linux-amd64" "-vvv" "serve" "restic" ":memory:"]
2025/06/19 16:21:07 DEBUG : Creating backend with remote ":memory:"
2025/06/19 16:21:07 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
2025/06/19 16:21:07 NOTICE: Memory root '': Serving restic REST API on [http://127.0.0.1:8080/]

Running via systemd-run works:

root@charon:~# systemd-run -GPt /usr/local/bin/rclone_v1.70.1-linux-amd64 -vvv serve restic :memory:
Running as unit: run-u18.service
Press ^] three times within 1s to disconnect TTY.
2025/06/19 16:21:33 DEBUG : rclone: Version "v1.70.1" starting with parameters ["/usr/local/bin/rclone_v1.70.1-linux-amd64" "-vvv" "serve" "restic" ":memory:"]
2025/06/19 16:21:33 DEBUG : Creating backend with remote ":memory:"
2025/06/19 16:21:33 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
2025/06/19 16:21:33 NOTICE: Memory root '': Serving restic REST API on [http://127.0.0.1:8080/]

Try to launch systemd-service with such unit file does not work:

[Service]
Type=simple
ExecStart="/usr/local/bin/rclone_v1.70.1-linux-amd64" "-vvv" "serve" "restic" ":memory:"

The process does not output anything and never starts listening at any port. Replacing -vvv with --log-level=DEBUG does not yield any output either.

The rclone config contents with secrets removed.

Irrelevant. There is none.

A log from the command with the -vv flag

Literally:

welcome to the forum,

[Service]
Type=simple
ExecStart=rclone serve restic :memory: --log-level=DEBUG --log-file=/root/rclone/rclone.log

rclone.service
     Loaded: loaded (/etc/systemd/system/rclone.service; static)
     Active: active (running) since Thu 2025-06-19 10:43:53 EDT; 30ms ago
   Main PID: 1046777 (rclone)
      Tasks: 5 (limit: 4524)
     Memory: 1.5M
        CPU: 14ms
     CGroup: /system.slice/rclone.service
             └─1046777 rclone serve restic :memory: --log-level=DEBUG --log-file=/root/rclone/rclone.log

Jun 19 10:43:53 hetz05 systemd[1]: Started rclone.service.

cat rclone.log
2025/06/19 10:43:53 DEBUG : rclone: Version "v1.70.0" starting with parameters ["rclone" "serve" "restic" ":memory:" "--log-level=DEBUG" "--log-file=/root/rclone/rclone.log"]
2025/06/19 10:43:53 DEBUG : Creating backend with remote ":memory:"
2025/06/19 10:43:53 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2025/06/19 10:43:53 NOTICE: Memory root '': Serving restic REST API on [http://127.0.0.1:8080/]

Adding --log-file= indeed does allow rclone to start. Has this bug been properly reported already?

Edit:
This seems to be the same issue: Cannot start web remote control on 1.70.0 as systemd service

I don't think there is a GitHub issue about this yet.

There were extensive behind the scenes changes to the logging system. I wonder if we broke the systemd integration somehow.

Please make a GitHub issue about it with anything you find out.

After a recent update to rclone 1.70.0, I had the same issue with rclone server webdav.

[Unit]
Description=Rclone WebDAV Service
After=network.target
[Service]
ExecStart=/usr/local/bin/rclone_webdav.sh
Restart=always
[Install]
WantedBy=multi-user.target
#!/usr/bin/env bash
declare -r serve='/root/webdav/data'
declare -r port='10001'
/usr/bin/rclone serve webdav "$serve" --addr ":$port" --htpasswd /etc/rclone/htpasswords

systemctl status rclone_webdav.service did not report any errors:

● rclone_webdav.service - Rclone WebDAV Service
     Loaded: loaded (/etc/systemd/system/rclone_webdav.service; enabled; preset: disabled)
     Active: active (running) since Thu 2025-06-19 15:22:19 MDT; 4s ago
Invocation: ba5ee47a19a5432babb505a8d7b13651
   Main PID: 348831 (bash)
      Tasks: 17 (limit: 76798)
     Memory: 24.9M (peak: 26.9M)
        CPU: 52ms
     CGroup: /system.slice/rclone_webdav.service
             ├─348831 bash /usr/local/bin/rclone_webdav.sh
             └─348835 /usr/bin/rclone serve webdav /root/webdav/data --addr :10001 --htpasswd /etc/rclone/h>
Jun 19 15:22:19 Alices-Computer systemd[1]: Started Rclone WebDAV Service.

This is odd, since running /usr/local/bin/rclone_webdav.sh directly in a shell worked without issue. However, the systemd service didn't even connect to port 10001, as shown by the output of ss -tunlp.

Adding --log-file=/dev/null to the script made it work, like:

#!/usr/bin/env bash
declare -r serve='/root/webdav/data'
declare -r port='10001'
/usr/bin/rclone serve webdav "$serve" --addr ":$port" --htpasswd /etc/rclone/htpasswords --log-file=/dev/null

Reported here: rclone fails to start as systemd service · Issue #8621 · rclone/rclone · GitHub

This is fixed in v1.70.2

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