Skip to content

Commit 03da3a8

Browse files
committed
When systemd service fail to start, use an exponential backoff delay to restart it
This solves an issue that on (at least) Fedora and if NetworkManager starts too slow, systemd may stop trying to start it.
1 parent f13dea3 commit 03da3a8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

systemd/doh-client.service

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ AmbientCapabilities=CAP_NET_BIND_SERVICE
1010
ExecStart=/usr/local/bin/doh-client -conf /etc/dns-over-https/doh-client.conf
1111
LimitNOFILE=1048576
1212
Restart=always
13-
RestartSec=3
13+
RestartSec=1s
14+
RestartMaxDelaySec=76s
15+
RestartSteps=9
16+
StartLimitIntervalSec=0
1417
Type=simple
1518
DynamicUser=yes
1619

systemd/doh-server.service

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ AmbientCapabilities=CAP_NET_BIND_SERVICE
88
ExecStart=/usr/local/bin/doh-server -conf /etc/dns-over-https/doh-server.conf
99
LimitNOFILE=1048576
1010
Restart=always
11-
RestartSec=3
11+
RestartSec=1s
12+
RestartMaxDelaySec=76s
13+
RestartSteps=9
14+
StartLimitIntervalSec=0
1215
Type=simple
1316
DynamicUser=yes
1417

0 commit comments

Comments
 (0)