From: Teemu Toivola Date: Mon, 6 May 2019 15:44:21 +0000 (+0300) Subject: increase example systemd service restart delay from default 100ms to 2s, configure... X-Git-Tag: v2.3~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cda3800b306fd5b5f30a323514abcdd06790243d;p=vnstat increase example systemd service restart delay from default 100ms to 2s, configure start rate limits, define ReadWritePaths (which can't be /var/lib/vnstat) to support those systems with such systemd version which supports ProtectSystem=strict but not StateDirectory, closes #131 --- diff --git a/CHANGES b/CHANGES index b5207fa..83e39d7 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,9 @@ - Traffic rate wasn't being shown for the last entry of most lists during the first update of the next period (first SaveInterval minutes of each new hour, day, month and year) + - Systemd example service file could result in database file write issues + if the used systemd version supported ProtectSystem=strict but didn't + support StateDirectory (issue seen at least with systemd 232 in Debian 9) 2.2 / 28-Apr-2018 diff --git a/examples/systemd/vnstat.service b/examples/systemd/vnstat.service index 9a39994..104082e 100644 --- a/examples/systemd/vnstat.service +++ b/examples/systemd/vnstat.service @@ -2,14 +2,18 @@ Description=vnStat network traffic monitor Documentation=man:vnstatd(1) man:vnstat(1) man:vnstat.conf(5) After=network.target +StartLimitIntervalSec=20 +StartLimitBurst=4 [Service] ExecStart=/usr/sbin/vnstatd -n ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure +RestartSec=2 # Hardening ProtectSystem=strict +ReadWritePaths=/var/lib StateDirectory=vnstat PrivateDevices=yes ProtectKernelTunables=yes