From 9c6c5f0b52384dfe71ec3df833fbf7e9f3769663 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 21 Jan 2016 08:08:49 -0500 Subject: apache2.initd: capture config test output in checkconfig(). The configtest() command in the init script calls "apache2 -t" to test the configuration for syntax errors. Before this commit, the command was run twice -- once to see if there was an error, and once to output the error to the user. We can capture the output in a variable the first time; this commit does so, and prints the contents of that variable when there is an error. --- 2.4/init/apache2.initd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2.4/init/apache2.initd b/2.4/init/apache2.initd index f86a31e..23d1746 100755 --- a/2.4/init/apache2.initd +++ b/2.4/init/apache2.initd @@ -61,11 +61,11 @@ checkconfig() { checkpath --directory /run/apache_ssl_mutex checkconfd || return 1 - ${APACHE2} ${APACHE2_OPTS} -t 1>/dev/null 2>&1 + OUTPUT=$( ${APACHE2} ${APACHE2_OPTS} -t 2>&1 ) ret=$? if [ $ret -ne 0 ]; then eerror "${SVCNAME} has detected an error in your setup:" - ${APACHE2} ${APACHE2_OPTS} -t + printf "%s\n" "${OUTPUT}" fi return $ret -- cgit v1.2.3-65-gdbad