From 4055e61fcd4834cdb3c1d67b3878b76f5e0927a7 Mon Sep 17 00:00:00 2001 From: ertugerata Date: Sat, 5 Sep 2015 20:01:52 +0300 Subject: [PATCH] cgmanager; added service.py --- util/admin/cgmanager/comar/service.py | 31 +++++++++++++++++++++++++++ util/admin/cgmanager/pspec.xml | 4 ++++ 2 files changed, 35 insertions(+) create mode 100644 util/admin/cgmanager/comar/service.py diff --git a/util/admin/cgmanager/comar/service.py b/util/admin/cgmanager/comar/service.py new file mode 100644 index 0000000000..169501f76d --- /dev/null +++ b/util/admin/cgmanager/comar/service.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +from comar.service import * + +serviceType = "local" +serviceDesc = _({"en": "Cgroup Management Daemon", + "tr": "Cgroup Yƶnetim Servisi"}) + +serviceDefault="on" + +CGMANAGER_PIDFILE = "/run/cgmanager.pid" +CGPROXY_PIDFILE = "/run/cgproxy.pid" + +@synchronized +def start(): + startService(command="/usr/bin/cgmanager", + args="--daemon --mount=subsystems", + donotify=True) + + + startService(command="/usr/bin/cgproxy", + args="--daemon", + donotify=True) + +@synchronized +def stop(): + stopService(pidfile=CGPROXY_PIDFILE, donotify=True) + stopService(pidfile=CGMANAGER_PIDFILE, donotify=True) + +def status(): + result = isServiceRunning(CGMANAGER_PIDFILE) and isServiceRunning(CGPROXY_PIDFILE) + return result diff --git a/util/admin/cgmanager/pspec.xml b/util/admin/cgmanager/pspec.xml index 393ff1fddf..281376597a 100644 --- a/util/admin/cgmanager/pspec.xml +++ b/util/admin/cgmanager/pspec.xml @@ -16,6 +16,7 @@ libnih-devel pam-devel + help2man @@ -33,6 +34,9 @@ /usr/share/cgmanager /usr/lib/libcgmanager* + + System.Service + cgmanager-devel