Files
main/x11/misc/bumblebee/comar/service.py
T
2016-04-10 19:45:21 +03:00

37 lines
707 B
Python

# -*- coding: utf-8 -*-
from comar.service import *
import os
serviceType = "local"
serviceDesc = _({"en": "FIXME",
"tr": "FIXME"})
serviceDefault = "on"
PIDFILE = "/run/bumblebeed.pid"
DAEMON = "/usr/sbin/bumblebeed"
@synchronized
def start():
os.system("modprobe bbswitch load_state=0 unload_state=1")
startService(command=DAEMON,
args="--daemon",
detach=True)
os.system("pidof -o %PPID " + "%s > %s" % (DAEMON, PIDFILE))
@synchronized
def stop():
stopService(pidfile=PIDFILE,
donotify=True)
try:
os.unlink(PIDFILE)
except:
pass
def status():
return isServiceRunning(pidfile=PIDFILE)