From fde7e7c7d8a3f98ab9b7025a87dd60c22b194ea0 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Thu, 8 Dec 2005 17:15:33 +0000 Subject: 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 --- src/lib/Client/Debian.py | 1 + src/lib/Client/Redhat.py | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src') 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')) -- cgit v1.2.3-1-g7c22