summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Client/Tools')
-rw-r--r--src/lib/Client/Tools/RcUpdate.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/Client/Tools/RcUpdate.py b/src/lib/Client/Tools/RcUpdate.py
index 5b64b2af0..1e5d29c86 100644
--- a/src/lib/Client/Tools/RcUpdate.py
+++ b/src/lib/Client/Tools/RcUpdate.py
@@ -17,22 +17,22 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool):
Verify Service status for entry.
Assumes we run in the "default" runlevel.
'''
- # check if init script exists
- try:
- os.stat('/etc/init.d/%s' % entry.get('name'))
- except OSError:
- self.logger.debug("Init script for service %s does not exist" %
- entry.get('name'))
- return False
-
# check is service is enabled
- cmd = '/etc/init.d/%s status | grep started'
+ cmd = '/sbin/rc-update show default | grep %s'
rc = self.cmd.run(cmd % entry.get('name'))[0]
is_enabled = (rc == 0)
if entry.get('mode', 'default') == 'supervised':
+ # check if init script exists
+ try:
+ os.stat('/etc/init.d/%s' % entry.get('name'))
+ except OSError:
+ self.logger.debug('Init script for service %s does not exist' %
+ entry.get('name'))
+ return False
+
# check is service is enabled
- cmd = '/bin/rc-status -s | grep %s | grep started'
+ cmd = '/etc/init.d/%s status | grep started'
rc = self.cmd.run(cmd % entry.attrib['name'])[0]
is_running = (rc == 0)
else:
@@ -62,7 +62,7 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool):
entry.get('name'))
return False
- self.logger.info("Installing Service %s" % entry.get('name'))
+ self.logger.info('Installing Service %s' % entry.get('name'))
if entry.get('status') == 'on':
# make sure it's enabled
cmd = '/sbin/rc-update add %s default'