diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2007-01-10 20:30:28 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2007-01-10 20:30:28 +0000 |
commit | f452accd981ac988b46036c4f097dec73084e09e (patch) | |
tree | 2a5de59fcaa881590afb976d225a4d5c7b41c0e1 /src/lib/Client | |
parent | 23850fbb759c114f3a4d3f43facb82366a7e94fc (diff) | |
download | bcfg2-f452accd981ac988b46036c4f097dec73084e09e.tar.gz bcfg2-f452accd981ac988b46036c4f097dec73084e09e.tar.bz2 bcfg2-f452accd981ac988b46036c4f097dec73084e09e.zip |
Report on service restart errors (Begin to address Debian Bug 406288)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2640 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r-- | src/lib/Client/Tools/__init__.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py index 20a8812a5..42ead2ed9 100644 --- a/src/lib/Client/Tools/__init__.py +++ b/src/lib/Client/Tools/__init__.py @@ -248,8 +248,10 @@ class SvcTool(Tool): if self.handlesEntry(entry): if entry.get('status') == 'on': self.logger.debug('Restarting service %s' % entry.get('name')) - self.cmd.run('/etc/init.d/%s %s' % \ - (entry.get('name'), entry.get('reload', 'reload'))) + rc = self.cmd.run('/etc/init.d/%s %s' % \ + (entry.get('name'), entry.get('reload', 'reload')))[0] else: self.logger.debug('Stopping service %s' % entry.get('name')) - self.cmd.run('/etc/init.d/%s stop' % (entry.get('name'))) + rc = self.cmd.run('/etc/init.d/%s stop' % (entry.get('name')))[0] + if rc: + self.logger.error("Failed to restart service %s" % (entry.get('name'))) |