From 1de3632620c01887317fb54341ce75f3290bfa7e Mon Sep 17 00:00:00 2001 From: Oleksandr Natalenko Date: Sun, 4 Oct 2020 20:08:55 +0200 Subject: [PATCH 1/2] contrib/systemd: implement service timeout Sometimes while doing a suspend/resume cycle vdirsyncer can hang in the middle of sync, and it never bails out afterwards. Implement a systemd service change that works around this: * use `simple` (a default) type for `RuntimeMaxSec` to be effective * actually set `RuntimeMaxSec` to 30 seconds * trigger service restart on failure Signed-off-by: Oleksandr Natalenko --- contrib/vdirsyncer.service | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/vdirsyncer.service b/contrib/vdirsyncer.service index b69d5a6..ac5c45c 100644 --- a/contrib/vdirsyncer.service +++ b/contrib/vdirsyncer.service @@ -4,4 +4,5 @@ Documentation=https://vdirsyncer.readthedocs.org/ [Service] ExecStart=/usr/bin/vdirsyncer sync -Type=oneshot +RuntimeMaxSec=30s +Restart=on-failure From f79647b29c3a7d979955934d11461aa36f5ed0bd Mon Sep 17 00:00:00 2001 From: Oleksandr Natalenko Date: Sun, 4 Oct 2020 22:08:41 +0200 Subject: [PATCH 2/2] contrib/systemd: extend timeout to 3 mins Some people may have mixes of many servers and/or slow connections, and we'd rather not break for them. Signed-off-by: Oleksandr Natalenko --- contrib/vdirsyncer.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/vdirsyncer.service b/contrib/vdirsyncer.service index ac5c45c..5f4a5a0 100644 --- a/contrib/vdirsyncer.service +++ b/contrib/vdirsyncer.service @@ -4,5 +4,5 @@ Documentation=https://vdirsyncer.readthedocs.org/ [Service] ExecStart=/usr/bin/vdirsyncer sync -RuntimeMaxSec=30s +RuntimeMaxSec=3m Restart=on-failure