From ef6c7492c1dc6b6a83ed8e0ecb5632d888ea6514 Mon Sep 17 00:00:00 2001 From: alick01 Date: Tue, 1 Jun 2021 23:58:16 +0300 Subject: [PATCH] vnstat adding service daemon --- network/monitor/vnstat/comar/vnstatd.py | 22 ++++++++++++++++++++++ network/monitor/vnstat/pspec.xml | 5 ++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 network/monitor/vnstat/comar/vnstatd.py diff --git a/network/monitor/vnstat/comar/vnstatd.py b/network/monitor/vnstat/comar/vnstatd.py new file mode 100644 index 0000000000..421015b156 --- /dev/null +++ b/network/monitor/vnstat/comar/vnstatd.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from comar.service import * + +serviceType = "server" +serviceDesc = _({"en": "Simple Network traffic monitor Daemon", + "tr": "Basit bir ağ trafik görüntüleme Servisi"}) +serviceConf = "vnstatd" + +pidfile = "/run/vnstatd.pid" + +@synchronized +def start(): + startService(command="/usr/sbin/vnstatd", + args="-d -p %s " % pidfile, + donotify=True) + +@synchronized +def stop(): + stopService(pidfile=pidfile, donotify=True) + +def status(): + return isServiceRunning(pidfile) diff --git a/network/monitor/vnstat/pspec.xml b/network/monitor/vnstat/pspec.xml index 41287a789e..07b4f2d927 100644 --- a/network/monitor/vnstat/pspec.xml +++ b/network/monitor/vnstat/pspec.xml @@ -27,6 +27,9 @@ / + + System.Service + @@ -37,4 +40,4 @@ alicengizkurt@gmail.com - +