2 - fail gracefully if links is not installed on target system
3 - source sysconfig/httpd for custom env. vars etc.
4 - make httpd -t work even in SELinux
5 - pass $OPTIONS to all $HTTPD invocation
9 Upstream-Status: Vendor-specific changes for better initscript integration
11 --- httpd-2.4.1/support/apachectl.in.apctl
12 +++ httpd-2.4.1/support/apachectl.in
13 @@ -44,19 +44,25 @@ ARGV="$@"
14 # the path to your httpd binary, including options if necessary
15 HTTPD='@exp_sbindir@/@progname@'
17 -# pick up any necessary environment variables
18 -if test -f @exp_sbindir@/envvars; then
19 - . @exp_sbindir@/envvars
22 # a command that outputs a formatted text version of the HTML at the
23 # url given on the command line. Designed for lynx, however other
25 -LYNX="@LYNX_PATH@ -dump"
26 +if [ -x "@LYNX_PATH@" ]; then
27 + LYNX="@LYNX_PATH@ -dump"
32 # the URL to your server's mod_status status page. If you do not
33 # have one, then status and fullstatus will not work.
34 STATUSURL="http://localhost:@PORT@/server-status"
36 +# Source /etc/sysconfig/httpd for $HTTPD setting, etc.
37 +if [ -r /etc/sysconfig/httpd ]; then
38 + . /etc/sysconfig/httpd
42 # Set this variable to a command that increases the maximum
43 # number of file descriptors allowed per child process. This is
44 @@ -76,9 +82,27 @@ if [ "x$ARGV" = "x" ] ; then
48 +function checklynx() {
49 +if [ "$LYNX" = "none" ]; then
50 + echo "The 'links' package is required for this functionality."
55 +function testconfig() {
56 +# httpd is denied terminal access in SELinux, so run in the
57 +# current context to get stdout from $HTTPD -t.
58 +if test -x /usr/sbin/selinuxenabled && /usr/sbin/selinuxenabled; then
59 + runcon -- `id -Z` $HTTPD $OPTIONS -t
67 start|stop|restart|graceful|graceful-stop)
69 + $HTTPD $OPTIONS -k $ARGV
72 startssl|sslstart|start-SSL)
73 @@ -88,17 +112,18 @@ startssl|sslstart|start-SSL)
83 $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
91 + $HTTPD $OPTIONS "$@"