From c227c4581a0b77b19db5ed5b13006d2656283433 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Wed, 25 Apr 2012 16:34:59 +0200 Subject: [PATCH] Log when cfn-hup couldn't restart a service `service.restarted` hooks are not run when the restart failed. Signed-off-by: Tomas Sedovic --- heat/cfntools/cfn_helper.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/heat/cfntools/cfn_helper.py b/heat/cfntools/cfn_helper.py index 2267646f..475d1e7e 100644 --- a/heat/cfntools/cfn_helper.py +++ b/heat/cfntools/cfn_helper.py @@ -533,7 +533,11 @@ class ServicesHandler(object): running = command.status == 0 if ensure_running and not running: logging.info("Restarting service %s" % service) - handler(self, service, "start") + start_cmd = handler(self, service, "start") + if start_cmd.status != 0: + logging.warning('Service %s did not start. STDERR: %s' % + (service, start_cmd.stderr)) + return for h in self.hooks: self.hooks[h].event('service.restarted', service, self.resource) -- 2.45.2