summaryrefslogtreecommitdiff
path: root/ncserver
diff options
context:
space:
mode:
Diffstat (limited to 'ncserver')
-rw-r--r--ncserver/module/openrc.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/ncserver/module/openrc.py b/ncserver/module/openrc.py
index bbff980..e951af1 100644
--- a/ncserver/module/openrc.py
+++ b/ncserver/module/openrc.py
@@ -116,9 +116,8 @@ def check_alive(pidfile) -> bool:
try:
os.kill(pid, 0)
except OSError as ose:
- if ose.errno == errno.EPERM:
- return True # we can't send signal because it's alive
- return False
+ # If EPERM, we can't send the signal because it's alive.
+ return (ose.errno == errno.EPERM)
else:
return True
@@ -245,13 +244,13 @@ def running(node):
def operational(node):
"""Retrieve the service state for this device."""
- running(node) # Include the running configuration.
- svcs = util.subelm(node, 'svcs:service-status')
+ svcs = util.subelm(node, 'svcs:services')
for service in service_list():
svcnode = util.subelm(svcs, 'svcs:service')
svcnode.append(util.leaf_elm('svcs:name', service.name))
svcnode.append(util.leaf_elm('svcs:description', service.description))
+ svcnode.append(util.leaf_elm('svcs:enabled', service.enabled))
svcnode.append(util.leaf_elm(
'svcs:status', service.status().name.lower()
))