summaryrefslogtreecommitdiffstats
path: root/src/lib/Client
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-01-20 02:03:56 +0000
committerSol Jerome <solj@ices.utexas.edu>2010-01-20 02:03:56 +0000
commitea1910b595ddbbf0287abafba1399d55fd209322 (patch)
treeb3f01de71d0437bf7d6da5743466eeff0203f41f /src/lib/Client
parentbb4a736ac540c08a97191e41552acc534c7c1653 (diff)
downloadbcfg2-ea1910b595ddbbf0287abafba1399d55fd209322.tar.gz
bcfg2-ea1910b595ddbbf0287abafba1399d55fd209322.tar.bz2
bcfg2-ea1910b595ddbbf0287abafba1399d55fd209322.zip
RcUpdate: Fix Service detection on Gentoo (Patch from Thorsten Lockert #825) [bugfix]
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5689 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r--src/lib/Client/Tools/RcUpdate.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/Client/Tools/RcUpdate.py b/src/lib/Client/Tools/RcUpdate.py
index c558ee18b..58beb56a4 100644
--- a/src/lib/Client/Tools/RcUpdate.py
+++ b/src/lib/Client/Tools/RcUpdate.py
@@ -27,8 +27,18 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool):
# we want it on, it's not
entry.set('current_status', 'off')
else:
+ # we want it off, check if it is
+ rc, output = self.cmd.run('/bin/rc-status -u | grep %s | grep stopped' % \
+ entry.get('name'))
+ status = (rc == 0)
+ if not status:
+ # it's not off and should be
+ entry.set('current_status', 'on')
+ else:
+ if entry.get('status') == 'off':
# we want it off, it's not
entry.set('current_status', 'on')
+ return False;
return status
def InstallService(self, entry):