diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2006-12-21 15:27:55 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2006-12-21 15:27:55 +0000 |
commit | 87453978cfe1ef05d2a57112f58e778a97626cef (patch) | |
tree | 62c8c97a3163fe3b9da1ad883fb1c82b7d726062 /src/lib/Client/Tools | |
parent | fa2f524bb27853a86a6e505b13f4d25abc51303d (diff) | |
download | bcfg2-87453978cfe1ef05d2a57112f58e778a97626cef.tar.gz bcfg2-87453978cfe1ef05d2a57112f58e778a97626cef.tar.bz2 bcfg2-87453978cfe1ef05d2a57112f58e778a97626cef.zip |
Fix some error paths in SMF
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2604 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools')
-rw-r--r-- | src/lib/Client/Tools/SMF.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/Client/Tools/SMF.py b/src/lib/Client/Tools/SMF.py index 598fbe6cf..ce4d8261d 100644 --- a/src/lib/Client/Tools/SMF.py +++ b/src/lib/Client/Tools/SMF.py @@ -27,6 +27,7 @@ class SMF(Bcfg2.Client.Tools.Tool): def VerifyService(self, entry, _): '''Verify SMF Service Entry''' if not self.GetFMRI(entry): + self.logger.error("smf service %s doesn't have FMRI set" % entry.get('name')) return False if entry.get('FMRI').startswith('lrc'): filename = entry.get('FMRI').split('/')[-1] @@ -108,9 +109,15 @@ class SMF(Bcfg2.Client.Tools.Tool): if not self.canInstall(entry): self.logger.error("Insufficient information to restart service %s" % (entry.get('name'))) else: - if entry.get('status') == 'on': - self.logger.info("Restarting smf service %s" % (entry.get("FMRI"))) - self.cmd.run("/usr/sbin/svcadm restart %s" % (entry.get("FMRI"))) + if entry.get("FMRI").startswith('lrc'): + if entry.get('status') == 'on': + self.logger.info("Restarting smf/lrc service %s"%(entry.get("name"))) + self.cmd.run("/etc/init.d/%s %s" % (entry.get('name'), + entry.get('reload', 'reload'))) else: - self.cmd.run("/usr/sbin/svcadm disable %s" % (entry.get("FMRI"))) + if entry.get('status') == 'on': + self.logger.info("Restarting smf service %s" % (entry.get("FMRI"))) + self.cmd.run("/usr/sbin/svcadm restart %s" % (entry.get("FMRI"))) + else: + self.cmd.run("/usr/sbin/svcadm disable %s" % (entry.get("FMRI"))) |