diff options
author | 2016-01-21 08:08:49 -0500 | |
---|---|---|
committer | 2016-03-03 13:46:26 +0100 | |
commit | 9c6c5f0b52384dfe71ec3df833fbf7e9f3769663 (patch) | |
tree | 2802881fde783b495c198e80b2391291bd6d8f61 | |
parent | Removed security patches which went into apache-2.2.28. (diff) | |
download | apache-9c6c5f0b52384dfe71ec3df833fbf7e9f3769663.tar.gz apache-9c6c5f0b52384dfe71ec3df833fbf7e9f3769663.tar.bz2 apache-9c6c5f0b52384dfe71ec3df833fbf7e9f3769663.zip |
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.
-rwxr-xr-x | 2.4/init/apache2.initd | 4 |
1 files 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 |