fix broken acpid service.
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from comar.service import *
|
from comar.service import *
|
||||||
|
|
||||||
serviceType = "local"
|
serviceType = "local"
|
||||||
@@ -8,15 +7,15 @@ serviceDefault = "on"
|
|||||||
|
|
||||||
PIDFILE = "/run/acpid.pid"
|
PIDFILE = "/run/acpid.pid"
|
||||||
|
|
||||||
MSG_NO_PIDFILE = _({
|
#MSG_NO_PIDFILE = _({
|
||||||
"en" : "Could not reload acpid daemon as the PID file %s does not exist." % 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,
|
# "tr" : "%s PID dosyası mevcut olmadığından acpid hizmeti yeniden yüklenemiyor." % PIDFILE,
|
||||||
})
|
# })
|
||||||
|
|
||||||
@synchronized
|
@synchronized
|
||||||
def start():
|
def start():
|
||||||
startService(command="/usr/sbin/acpid",
|
startService(command="/usr/sbin/acpid",
|
||||||
args=config.get("OPTIONS", ""),
|
args=config.get("OPTIONS", "-p /run/acpid.pid"),
|
||||||
donotify=True)
|
donotify=True)
|
||||||
|
|
||||||
@synchronized
|
@synchronized
|
||||||
@@ -24,13 +23,13 @@ def stop():
|
|||||||
stopService(pidfile=PIDFILE,
|
stopService(pidfile=PIDFILE,
|
||||||
donotify=True)
|
donotify=True)
|
||||||
|
|
||||||
def reload():
|
#def reload():
|
||||||
import signal
|
# import signal
|
||||||
import os
|
# import os
|
||||||
try:
|
# try:
|
||||||
os.kill(int(open(PIDFILE, "r").read().strip()), signal.SIGHUP)
|
# os.kill(int(open(PIDFILE, "r").read().strip()), signal.SIGHUP)
|
||||||
except:
|
# except:
|
||||||
fail(MSG_NO_PIDFILE)
|
# fail(MSG_NO_PIDFILE)
|
||||||
|
|
||||||
def status():
|
def status():
|
||||||
return isServiceRunning(pidfile=PIDFILE)
|
return isServiceRunning(pidfile=PIDFILE)
|
||||||
|
|||||||
Reference in New Issue
Block a user