]> granicus.if.org Git - vnstat/commitdiff
provide alternative more simple systemd service file designed to work with also older...
authorTeemu Toivola <git@humdi.net>
Mon, 6 May 2019 21:43:46 +0000 (00:43 +0300)
committerTeemu Toivola <git@humdi.net>
Mon, 6 May 2019 21:43:46 +0000 (00:43 +0300)
INSTALL.md
examples/systemd/simple/vnstat.service [new file with mode: 0644]

index 3b327effeb3d87ed64a7b291f0802f058b5ff85a..278f11e9897ea22f98c8f3f8c72be2b2df620e4f 100644 (file)
@@ -64,12 +64,21 @@ service managers. Refer to your operating system / distribution
 documentation if unsure which service manager is being used.
 
  * systemd
+
+   * option 1: hardened - requires a more recent systemd version
     ~~~
     cp -v examples/systemd/vnstat.service /etc/systemd/system/
     systemctl enable vnstat
     systemctl start vnstat
     ~~~
 
+   * option 2: simple - works also with older systemd versions
+    ~~~
+    cp -v examples/systemd/simple/vnstat.service /etc/systemd/system/
+    systemctl enable vnstat
+    systemctl start vnstat
+    ~~~
+
  * init.d
 
    * Debian
diff --git a/examples/systemd/simple/vnstat.service b/examples/systemd/simple/vnstat.service
new file mode 100644 (file)
index 0000000..a74da48
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=vnStat network traffic monitor
+Documentation=man:vnstatd(1) man:vnstat(1) man:vnstat.conf(5)
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/vnstatd -n
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
+Alias=vnstatd.service