diff options
-rw-r--r-- | src/lib/Client/Solaris.py | 16 | ||||
-rw-r--r-- | src/lib/Client/Toolset.py | 5 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/Client/Solaris.py b/src/lib/Client/Solaris.py index 9cfdc7458..10464de78 100644 --- a/src/lib/Client/Solaris.py +++ b/src/lib/Client/Solaris.py @@ -94,9 +94,13 @@ class ToolsetImpl(Toolset): filename = entry.get('FMRI').split('/')[-1] # this is a legacy service gname = "/etc/rc*.d/%s" % filename - if glob(gname.replace('_', '.')): + files = glob(gname.replace('_', '.')) + if files: + self.logger.debug("Matched %s with %s" % \ + (entry.get("FMRI"), ":".join(files))) return entry.get('status') == 'on' else: + self.logger.debug("No service matching %s" % (entry.get("FMRI"))) return entry.get('status') == 'off' try: srvdata = self.saferun("/usr/bin/svcs -H -o STA %s" % entry.attrib['name'])[1][0].split() @@ -141,7 +145,10 @@ class ToolsetImpl(Toolset): if self.setup['dryrun']: print "Enabling Service %s" % (entry.attrib['name']) else: - cmdrc = self.saferun("/usr/sbin/svcadm enable -r %s" % (entry.attrib['FMRI']))[0] + if entry.get('FMRI').startswith('lrc'): + pass + else: + cmdrc = self.saferun("/usr/sbin/svcadm enable -r %s" % (entry.attrib['FMRI']))[0] return cmdrc == 0 def VerifyPackage(self, entry, modlist): @@ -229,5 +236,6 @@ class ToolsetImpl(Toolset): if service.get("FMRI").startswith('lrc'): Toolset.RestartService(self, service) else: - self.logger.debug("Restarting service %s" % (service.get("FMRI"))) - self.saferun("svcadm restart %s" % (service.get("FMRI"))) + if entry.get('status') == 'on': + self.logger.debug("Restarting service %s" % (service.get("FMRI"))) + self.saferun("svcadm restart %s" % (service.get("FMRI"))) diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py index 3861233b2..66c32568e 100644 --- a/src/lib/Client/Toolset.py +++ b/src/lib/Client/Toolset.py @@ -695,6 +695,7 @@ class Toolset(object): def RestartService(self, entry): '''Restart a service entry''' - self.logger.debug('Restarting service %s' % entry.get('name')) - self.saferun('/etc/init.d/%s %s' % (entry.get('name'), entry.get('reload', 'reload'))) + if entry.get('status') == 'on': + self.logger.debug('Restarting service %s' % entry.get('name')) + self.saferun('/etc/init.d/%s %s' % (entry.get('name'), entry.get('reload', 'reload'))) |