From 7e616c40a7e928f7f8a7fc157498e0fafba65d58 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 19 Jan 2005 03:47:01 +0000 Subject: add extra service support (Logical change 1.192) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@815 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Debian.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/lib/Client/Debian.py') diff --git a/src/lib/Client/Debian.py b/src/lib/Client/Debian.py index c34c82eb0..bb22edeb1 100644 --- a/src/lib/Client/Debian.py +++ b/src/lib/Client/Debian.py @@ -28,7 +28,8 @@ class Debian(Toolset): system("apt-get -q=2 -y update") self.installed = {} self.installed_this_run = [] - self.pkgwork = {'add':[], 'update':[], 'remove':[]} + self.pkgwork = {'add':[], 'update':[], 'remove':[]} + self.extra_services = [] self.Refresh() def Refresh(self): @@ -124,12 +125,18 @@ class Debian(Toolset): # pkgwork contains all one-way verification data now # all data remaining in all is extra packages self.pkgwork['remove'] = all.keys() + # now for packages + allsrv = [] + [allsrv.append(x[14:]) for x in glob.glob("/etc/rc[12345].d/S*") if x[14:] not in allsrv] + csrv = self.cfg.findall(".//Service") + [allsrv.remove(svc.get('name')) for svc in csrv if svc.get('status') == 'on'] + self.extra_services = allsrv def Install(self): '''Correct detected misconfigurations''' self.CondPrint("verbose", "Installing needed configuration changes") cmd = '''apt-get --reinstall -q=2 --force-yes -y install %s''' - print "Need to remove:", self.pkgwork['remove'] + print "Need to remove:", self.pkgwork['remove'], self.extra_services self.setup['quick'] = True self.CondPrint('dryrun', "Packages to update: %s" % (" ".join([pkg.get('name') for pkg in self.pkgwork['update']]))) -- cgit v1.2.3-1-g7c22