diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2005-12-08 17:15:33 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2005-12-08 17:15:33 +0000 |
commit | fde7e7c7d8a3f98ab9b7025a87dd60c22b194ea0 (patch) | |
tree | dc822756988a4c835537e4b1b78f4f3494d14c1c /src/lib/Client | |
parent | 2769d83e0b648d1d623b4a1648973d6c32945b13 (diff) | |
download | bcfg2-fde7e7c7d8a3f98ab9b7025a87dd60c22b194ea0.tar.gz bcfg2-fde7e7c7d8a3f98ab9b7025a87dd60c22b194ea0.tar.bz2 bcfg2-fde7e7c7d8a3f98ab9b7025a87dd60c22b194ea0.zip |
Stop services on debian if they are enabled but shouldn't be
Produce a reasonable error message if the server completely bound service entries
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1616 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r-- | src/lib/Client/Debian.py | 1 | ||||
-rw-r--r-- | src/lib/Client/Redhat.py | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/Client/Debian.py b/src/lib/Client/Debian.py index 75fa1ef65..a7960571f 100644 --- a/src/lib/Client/Debian.py +++ b/src/lib/Client/Debian.py @@ -74,6 +74,7 @@ class Debian(Toolset): if self.setup['dryrun']: print "Disabling service %s" % (entry.get('name')) else: + system("/etc/init.d/%s stop > /dev/null 2>&1" % (entry.get('name'))) cmdrc = system("update-rc.d -f %s remove" % entry.get('name')) else: if self.setup['dryrun']: diff --git a/src/lib/Client/Redhat.py b/src/lib/Client/Redhat.py index 4992b04d1..4e83a15c8 100644 --- a/src/lib/Client/Redhat.py +++ b/src/lib/Client/Redhat.py @@ -61,6 +61,9 @@ class Redhat(Toolset): '''Install Service entry''' system("/sbin/chkconfig --add %s"%(entry.attrib['name'])) self.CondPrint('verbose', "Installing Service %s" % (entry.get('name'))) + if not entry.get('status'): + print "Can't install service %s, not enough data" % (entry.get('name')) + return False if entry.attrib['status'] == 'off': if self.setup['dryrun']: print "Disabling server %s" % (entry.get('name')) |