Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 79159 - Apache2 configtest paramater on init script /etc/init.d/apache2
Summary: Apache2 configtest paramater on init script /etc/init.d/apache2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-22 16:44 UTC by Jamie Furtner
Modified: 2005-01-29 01:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jamie Furtner 2005-01-22 16:44:43 UTC
The included apache2 init script doesn't have an easy method to do a test of the configuration without a stop / start. If you're making changes and want to test those changes without taking the server down, a configtest is what would normally be used on a standard Apache installation. You could also use /usr/sbin/apache2 -t $APACHE_OPTS_FROM_CONF.D but that's a bit cumbersome.

I've included a patch to add the option, which just calls checkconfig and reports success if the check succeeds, or lets the checkconfig display any errors.

Reproducible: Always
Steps to Reproduce:
1. Run /etc/init.d/apache2 configtest
Actual Results:  
Normal init script invalid arguments display.

Expected Results:  
Either a report of the error or a note that there were no errors encountered.

--- apache2.initd       2005-01-22 17:33:49.462073551 -0700
+++ apache2     2005-01-22 17:10:45.000000000 -0700
@@ -3,7 +3,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/net-www/apache/files/2.0.49/apache2.initd,v
1.8 2004/07/15 00:24:42 agriffis Exp $

-opts="${opts} reload"
+opts="${opts} reload configtest"

 [ "x${SERVERROOT}" != "x" ] && APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}"
 [ "x${CONFIGFILE}" != "x" ] && APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}"
@@ -14,6 +14,12 @@
 [ -z "${PIDFILE}" ] && PIDFILE=/var/run/apache2.pid
 [ -z "${RESTARTSTYLE}" ] && RESTARTSTYLE="graceful"

+configtest()
+{
+       checkconfig || return 1
+       einfo "Apache configuration OK"
+}
+
 checkconfig() {
        local myconf="/etc/apache2/conf/apache2.conf"
        if [ "x${CONFIGFILE}" != "x" ]; then
Comment 1 Carsten Lohrke (RETIRED) gentoo-dev 2005-01-22 16:50:41 UTC
Jamie: please do not inline, always attach as plain text
Comment 2 Benedikt Böhm (RETIRED) gentoo-dev 2005-01-29 01:54:15 UTC
this is fixed in cvs, please try currently hard masked ebuilds (1.3.33-r1 and 2.0.52-r3) it may take some hrs until the new tarballs are on the mirrors..

see also http://dev.gentoo.org/~vericgar/package-refresh.txt