Files
main/hardware/powermanagement/acpid/comar/service.py
T
2016-07-02 17:13:07 +03:00

37 lines
940 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
from comar.service import *
serviceType = "local"
serviceDesc = _({"en": "ACPI Daemon",
"tr": "ACPI Hizmeti"})
serviceDefault = "on"
PIDFILE = "/run/acpid.pid"
MSG_NO_PIDFILE = _({
"en" : "Could not reload acpid daemon as the PID file %s does not exist." % PIDFILE,
"tr" : "%s PID dosyası mevcut olmadığından acpid hizmeti yeniden yüklenemiyor." % PIDFILE,
})
@synchronized
def start():
startService(command="/usr/sbin/acpid",
args=config.get("OPTIONS", ""),
donotify=True)
@synchronized
def stop():
stopService(pidfile=PIDFILE,
donotify=True)
def reload():
import signal
import os
try:
os.kill(int(open(PIDFILE, "r").read().strip()), signal.SIGHUP)
except:
fail(MSG_NO_PIDFILE)
def status():
return isServiceRunning(pidfile=PIDFILE)