[PATCH aeolus-configure] BZ852509 - aeolus-check-services always returns 0, no $RETVAL
Steve Linabery
slinaber at redhat.com
Tue Sep 4 16:28:00 UTC 2012
Made the script exit with 1 if a service is detected as not running.
---
bin/aeolus-check-services | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/bin/aeolus-check-services b/bin/aeolus-check-services
index 27013c2..eb35550 100755
--- a/bin/aeolus-check-services
+++ b/bin/aeolus-check-services
@@ -29,6 +29,7 @@ end
# ordered as in rc.d
init_scripts=%w(mongod iwhd postgresql httpd deltacloud-core libvirtd aeolus-conductor conductor-delayed_job conductor-dbomatic imagefactory ntpd)
+exit_status = 0
init_scripts.each do |script|
puts "\nChecking #{script} ..."
cmd = "service #{script} status"
@@ -36,6 +37,8 @@ init_scripts.each do |script|
if $?.to_i == 0
puts " \e[1;32mSuccess:\e[0m #{out.strip}"
else
+ exit_status = 1
puts " \e[1;31mFAILURE:\e[0m #{out.strip}"
end
end
+exit(exit_status)
--
1.7.7.6
More information about the aeolus-devel
mailing list