diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2007-11-30 20:53:09 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2007-11-30 20:53:09 +0000 |
commit | 9ecb8d6f50c6b065a4bc72ccf07d3b4e6df34917 (patch) | |
tree | 8273e540850a92c2072aeb34e6e46a5a91de7a85 /src | |
parent | 302759a996e82fb8761b3a789154a5108a41773f (diff) | |
download | bcfg2-9ecb8d6f50c6b065a4bc72ccf07d3b4e6df34917.tar.gz bcfg2-9ecb8d6f50c6b065a4bc72ccf07d3b4e6df34917.tar.bz2 bcfg2-9ecb8d6f50c6b065a4bc72ccf07d3b4e6df34917.zip |
Fix chkconfig services that run in runlevel 1 [bugfix]
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4014 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Client/Tools/Chkconfig.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/Client/Tools/Chkconfig.py b/src/lib/Client/Tools/Chkconfig.py index ded4ef16a..8a6abd391 100644 --- a/src/lib/Client/Tools/Chkconfig.py +++ b/src/lib/Client/Tools/Chkconfig.py @@ -51,10 +51,15 @@ class Chkconfig(Bcfg2.Client.Tools.SvcTool): def InstallService(self, entry): '''Install Service entry''' + rcmd = "/sbin/chkconfig %s %s" self.cmd.run("/sbin/chkconfig --add %s"%(entry.attrib['name'])) self.logger.info("Installing Service %s" % (entry.get('name'))) - return self.cmd.run("/sbin/chkconfig %s %s" % (entry.get('name'), - entry.get('status')))[0] == 0 + pass1 = True + if entry.get('status') == 'off': + rc = self.cmd.run(rcmd % (entry.get('name'), entry.get('status')) + " --level 1")[0] + pass1 = rc == 0 + rc = self.cmd.run(rcmd % (entry.get('name'), entry.get('status'))[0] + return pass1 and rc == 0 def FindExtra(self): '''Locate extra chkconfig Services''' |