[icinga-checkins] icinga.org: icinga-core/master: improve output of rhel init-script

git at icinga.org git at icinga.org
Tue Jul 27 16:31:28 CEST 2010


Module: icinga-core
Branch: master
Commit: d5644d1588342f6d79026b913d6579b6937e251c
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=d5644d1588342f6d79026b913d6579b6937e251c

Author: Christoph Maser <cmr at financial.com>
Date:   Sun Jul 25 00:42:04 2010 +0200

improve output of rhel init-script

---

 daemon-init-redhat.in |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/daemon-init-redhat.in b/daemon-init-redhat.in
index 836d8aa..6e456f4 100644
--- a/daemon-init-redhat.in
+++ b/daemon-init-redhat.in
@@ -68,10 +68,12 @@ force_reload() {
 check_config() {
         $nice runuser -s /bin/bash - $user -c "$corelimit >/dev/null 2>&1 ; $exec -v $config > /dev/null 2>&1"
 	RETVAL=$?
-	if [ $RETVAL -ne 0 ] ; then
-		echo "Configuration error: please check the config by runing \"$exec -v $config\""
-		exit 1
-	fi
+        if [ $RETVAL -ne 0 ] ; then
+                echo -n $"Configuration validation failed"
+                failure
+                echo
+                exit 1
+        fi
 }
 
 case "$1" in
@@ -104,7 +106,10 @@ case "$1" in
         restart
         ;;
    configtest)
-	check_config
+        echo -n  $"Checking config for $prog: "
+        check_config && success
+        echo
+
 	;;
     *)
         echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"





More information about the icinga-checkins mailing list