packages: nagios/nagios.init - allow output of configtest success
glen
glen at pld-linux.org
Sat Jul 25 21:46:52 CEST 2009
Author: glen Date: Sat Jul 25 19:46:52 2009 GMT
Module: packages Tag: HEAD
---- Log message:
- allow output of configtest success
---- Files affected:
packages/nagios:
nagios.init (1.21 -> 1.22)
---- Diffs:
================================================================
Index: packages/nagios/nagios.init
diff -u packages/nagios/nagios.init:1.21 packages/nagios/nagios.init:1.22
--- packages/nagios/nagios.init:1.21 Sat Jul 25 21:29:16 2009
+++ packages/nagios/nagios.init Sat Jul 25 21:46:47 2009
@@ -27,12 +27,8 @@
# configtest itself
configtest() {
- local rc out
- out=`/usr/sbin/nagios -v /etc/nagios/nagios.cfg 2>&1`; rc=$?
- if [ $rc -gt 0 ]; then
- echo >&2 "$out"
- fi
- return $rc
+ /usr/sbin/nagios -v /etc/nagios/nagios.cfg 2>&1
+ return $?
}
# wrapper for configtest:
@@ -49,8 +45,8 @@
ok
else
fail
- echo >&2 "$out"
fi
+ [ "$out" ] && echo >&2 "$out"
else
# run config test and abort with nice message if failed
# (for actions checking status before action).
@@ -95,30 +91,30 @@
rm -f /var/lock/subsys/nagios > /dev/null 2>&1
}
-condrestart() {
+reload() {
if [ ! -f /var/lock/subsys/nagios ]; then
msg_not_running "Nagios"
- RETVAL=$1
+ RETVAL=7
return
fi
checkconfig
- stop
- start
+ msg_reloading "Nagios"
+
+ killproc nagios -HUP
+ RETVAL=$?
}
-reload() {
+condrestart() {
if [ ! -f /var/lock/subsys/nagios ]; then
msg_not_running "Nagios"
- RETVAL=7
+ RETVAL=$1
return
fi
checkconfig
- msg_reloading "Nagios"
-
- killproc nagios -HUP
- RETVAL=$?
+ stop
+ start
}
RETVAL=0
@@ -141,7 +137,7 @@
reload|force-reload)
reload
;;
- checkconfig|check|configtest)
+ checkconfig|configtest)
checkconfig 1
;;
status)
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nagios/nagios.init?r1=1.21&r2=1.22&f=u
More information about the pld-cvs-commit
mailing list