NM moved into main for pisi20

This commit is contained in:
2015-07-09 08:56:28 +03:00
parent d4dd0b1ad1
commit a1a1ef18d9
15 changed files with 3003 additions and 0 deletions
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
from comar.service import *
import os
serviceType = "local"
serviceDesc = _({"en": "Network Manager",
"tr": "Ağ Yöneticisi Hizmeti"})
serviceDefault = "conditional"
MSG_BACKEND_WARNING = _({
"en" : "NetworkManager is not enabled by default. You can change this from /etc/conf.d/NetworkManager.",
"tr" : "NetworkManager öntanımlı olarak etkin değil. /etc/conf.d/NetworkManager dosyasından bu ayarı değiştirebilirsiniz."
})
PIDFILE="/run/NetworkManager/NetworkManager.pid"
USETHIS=eval(config.get("DEFAULT", "True"))
@synchronized
def start():
if not USETHIS:
fail(MSG_BACKEND_WARNING)
startService(command="/usr/sbin/NetworkManager",
args="--pid-file=%s" % PIDFILE,
donotify=True)
@synchronized
def stop():
stopService(pidfile=PIDFILE,
donotify=True)
try:
os.unlink(PIDFILE)
except:
pass
def ready():
if not USETHIS:
fail(MSG_BACKEND_WARNING)
else:
start()
def status():
return isServiceRunning(pidfile=PIDFILE)