启动请求重复得太快

启动请求重复得太快

我正在尝试通过 定期备份 ( OnCalendar=daily) 到我的保管箱rclone。由于它在笔记本电脑上运行,因此我使用Persistent=true.如果我唤醒笔记本电脑,网络需要几秒钟的时间才能恢复。因此,预计唤醒后的第一次尝试会失败。但是,我不明白为什么我会得到Start request repeated too quickly error.

systemctl cat --user rclone-copy-dropbox.timer

[Install]
WantedBy=timers.target

[Timer]
OnCalendar=daily
Persistent=true
RandomizedDelaySec=10m

[Unit]
Description=rclone copy to dropbox

systemctl cat --user rclone-copy-dropbox.service

[Service]
ExecStart=rclone copy dropbox: /home/me/dropbox --bwlimit 10M:20M --config=/home/me/rclone.conf
Restart=on-failure
RestartSec=10m
Type=oneshot

[Unit]
After=graphical-session-pre.target
Description=rclone copy dropbox
OnFailure=notify-email@%n.service
StartLimitBurst=5
StartLimitIntervalSec=12h
Wants=graphical-session.target
X-RestartIfChanged=false

Journalctl --user -u rclone-copy-dropbox.service

Jan 08 11:52:14 yoga systemd[8306]: Starting rclone copy dropbox...
Jan 08 11:52:16 yoga systemd[8306]: Finished rclone copy dropbox.
Jan 09 07:15:44 yoga systemd[8306]: Starting rclone copy dropbox...
Jan 09 07:15:44 yoga rclone[2215956]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 09 07:15:44 yoga rclone[2215956]: ERROR : Attempt 1/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 09 07:15:44 yoga rclone[2215956]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 09 07:15:44 yoga rclone[2215956]: ERROR : Attempt 2/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 09 07:15:44 yoga rclone[2215956]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 09 07:15:44 yoga rclone[2215956]: ERROR : Attempt 3/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 09 07:15:44 yoga rclone[2215956]: Failed to copy: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 09 07:15:44 yoga systemd[8306]: rclone-copy-dropbox.service: Main process exited, code=exited, status=1/FAILURE
Jan 09 07:15:44 yoga systemd[8306]: rclone-copy-dropbox.service: Failed with result 'exit-code'.
Jan 09 07:15:44 yoga systemd[8306]: Failed to start rclone copy dropbox.
Jan 09 07:25:44 yoga systemd[8306]: rclone-copy-dropbox.service: Scheduled restart job, restart counter is at 1.
Jan 09 07:25:44 yoga systemd[8306]: Stopped rclone copy dropbox.
Jan 09 07:25:44 yoga systemd[8306]: rclone-copy-dropbox.service: Start request repeated too quickly.
Jan 09 07:25:44 yoga systemd[8306]: rclone-copy-dropbox.service: Failed with result 'exit-code'.
Jan 09 07:25:44 yoga systemd[8306]: Failed to start rclone copy dropbox.
Jan 09 07:25:44 yoga systemd[8306]: rclone-copy-dropbox.service: Triggering OnFailure= dependencies.
lines 1853-1892/1892 (END)

根据配置,在触发故障之前,12 小时内最多应进行 5 次尝试。我的推理有什么问题吗?

编辑:版本是systemd 252(252.1)

直接运行服务可以按预期工作。

systemctl Reset-failed --user rclone-copy-dropbox.service
systemctl start --user rclone-copy-dropbox.service

Jan 16 14:26:53 yoga systemd[7257]: Starting rclone copy dropbox...
Jan 16 14:26:54 yoga rclone[1412126]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:26:54 yoga rclone[1412126]: ERROR : Attempt 1/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:26:54 yoga rclone[1412126]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:26:54 yoga rclone[1412126]: ERROR : Attempt 2/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:26:54 yoga rclone[1412126]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:26:54 yoga rclone[1412126]: ERROR : Attempt 3/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:26:54 yoga rclone[1412126]: Failed to copy: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:26:54 yoga systemd[7257]: rclone-copy-dropbox.service: Main process exited, code=exited, status=1/FAILURE
Jan 16 14:26:54 yoga systemd[7257]: rclone-copy-dropbox.service: Failed with result 'exit-code'.
Jan 16 14:26:54 yoga systemd[7257]: Failed to start rclone copy dropbox.
Jan 16 14:36:54 yoga systemd[7257]: rclone-copy-dropbox.service: Scheduled restart job, restart counter is at 1.
Jan 16 14:36:54 yoga systemd[7257]: Stopped rclone copy dropbox.
Jan 16 14:36:54 yoga systemd[7257]: Starting rclone copy dropbox...
Jan 16 14:36:54 yoga rclone[1420729]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:36:54 yoga rclone[1420729]: ERROR : Attempt 1/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:36:54 yoga rclone[1420729]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:36:54 yoga rclone[1420729]: ERROR : Attempt 2/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:36:54 yoga rclone[1420729]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:36:54 yoga rclone[1420729]: ERROR : Attempt 3/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:36:54 yoga rclone[1420729]: Failed to copy: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:36:54 yoga systemd[7257]: rclone-copy-dropbox.service: Main process exited, code=exited, status=1/FAILURE
Jan 16 14:36:54 yoga systemd[7257]: rclone-copy-dropbox.service: Failed with result 'exit-code'.
Jan 16 14:36:54 yoga systemd[7257]: Failed to start rclone copy dropbox.
Jan 16 14:46:54 yoga systemd[7257]: rclone-copy-dropbox.service: Scheduled restart job, restart counter is at 2.
Jan 16 14:46:54 yoga systemd[7257]: Stopped rclone copy dropbox.
Jan 16 14:46:54 yoga systemd[7257]: Starting rclone copy dropbox...
Jan 16 14:46:54 yoga rclone[1427795]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:46:54 yoga rclone[1427795]: ERROR : Attempt 1/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:46:54 yoga rclone[1427795]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:46:54 yoga rclone[1427795]: ERROR : Attempt 2/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:46:54 yoga rclone[1427795]: ERROR : Dropbox root '': error reading source root directory: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:46:54 yoga rclone[1427795]: ERROR : Attempt 3/3 failed with 1 errors and: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:46:54 yoga rclone[1427795]: Failed to copy: Post "https://api.dropboxapi.com/2/files/list_folder": dial tcp: lookup api.dropboxapi.com: no such host
Jan 16 14:46:54 yoga systemd[7257]: rclone-copy-dropbox.service: Main process exited, code=exited, status=1/FAILURE
Jan 16 14:46:54 yoga systemd[7257]: rclone-copy-dropbox.service: Failed with result 'exit-code'.
Jan 16 14:46:54 yoga systemd[7257]: Failed to start rclone copy dropbox.
...

答案1

为什么不让该服务仅在网络启动并联机后运行?

After=network-online.target
Wants=network-online.target

然后在笔记本电脑唤醒并且网络连接起来后,服务就会运行。

相关内容