Merge pull request #8996 from 4fury-c3440d8/acpid
fix broken acpid service.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from comar.service import *
|
||||
|
||||
serviceType = "local"
|
||||
@@ -8,15 +7,15 @@ 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,
|
||||
})
|
||||
#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", ""),
|
||||
args=config.get("OPTIONS", "-p /run/acpid.pid"),
|
||||
donotify=True)
|
||||
|
||||
@synchronized
|
||||
@@ -24,13 +23,13 @@ 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 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)
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
|
||||
<History>
|
||||
<Update release="7">
|
||||
<Date>2020-11-07</Date>
|
||||
<Date>2021-02-18</Date>
|
||||
<Version>2.0.32</Version>
|
||||
<Comment>Version bump.</Comment>
|
||||
<Comment>Rebuild.</Comment>
|
||||
<Name>Mustafa Cinasal</Name>
|
||||
<Email>muscnsl@gmail.com</Email>
|
||||
</Update>
|
||||
|
||||
Reference in New Issue
Block a user