From ea1910b595ddbbf0287abafba1399d55fd209322 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Wed, 20 Jan 2010 02:03:56 +0000 Subject: RcUpdate: Fix Service detection on Gentoo (Patch from Thorsten Lockert #825) [bugfix] Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5689 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Tools/RcUpdate.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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): -- cgit v1.2.3-1-g7c22