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 - +