You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dave Hill <dd...@zk3.dec.com> on 2002/08/29 20:31:25 UTC

apachectl and options take 2


Hi again,
	I am back again with a proposed change to apachectl....
With the input from Aaron, I reworked my proposed fix/enhancement.
In a nutshell, for a wide variety of reasons I want apachectl to
pass -DWARP and other define toggles through to the server invocation.
Customers like apachectl, and I like giving them example code wrapped in
<Defined> blocks.

The proposed change does 2 things which follows the "all things to 
all people" approach that we seem to like.

First, ./apachectl start -DWARP -DSSL would now work with this change.
Currently adding the defines to the command line results in a error
message.

Second, despite Aarons reservations..... (no one else responded), this
change also supports the setting of HTTPD_OPTIONS in the environment,
which would then be added to the httpd invocation. This feature is 
important to me because I have this bad case of CRS (can't remember stuff)
an occasionally forget what toggles I have enabled. Adding this to the
script means that I can add the environment var into bin/envars or somewhere
else (like my init.d script) and have things work.

So..... any reactions to this proposal out there ?
Anyone want to sponsor this into the tree for me ?

thanks,
	Dave Hill

*** apachectl.in.orig	Thu Aug 29 11:20:36 2002
--- apachectl.in	Thu Aug 29 14:19:29 2002
***************
*** 22,28 ****
  # When multiple arguments are given, only the error from the _last_
  # one is reported.  Run "apachectl help" for usage info
  #
- ARGV="$@"
  #
  # |||||||||||||||||||| START CONFIGURATION SECTION  ||||||||||||||||||||
  # --------------------                              --------------------
--- 22,27 ----
***************
*** 58,78 ****
  fi
  
  ERROR=0
! if [ "x$ARGV" = "x" ] ; then 
!     ARGV="-h"
  fi
  
! case $ARGV in
  start|stop|restart|graceful)
!     $HTTPD -k $ARGV
      ERROR=$?
      ;;
  startssl|sslstart|start-SSL)
!     $HTTPD -k start -DSSL
      ERROR=$?
      ;;
  configtest)
!     $HTTPD -t
      ERROR=$?
      ;;
  status)
--- 57,82 ----
  fi
  
  ERROR=0
! if [ "x$1" = "x" ] ; then 
!     FIRST_ARG="-h"
!     ARGV=""
! else
!     FIRST_ARG=$1
!     shift
!     ARGV="$@"
  fi
  
! case $FIRST_ARG in
  start|stop|restart|graceful)
!     $HTTPD -k $FIRST_ARG $ARGV $HTTPD_OPTIONS
      ERROR=$?
      ;;
  startssl|sslstart|start-SSL)
!     $HTTPD -k start -DSSL $ARGV $HTTPD_OPTIONS
      ERROR=$?
      ;;
  configtest)
!     $HTTPD -t $ARGV $HTTPD_OPTIONS
      ERROR=$?
      ;;
  status)
***************
*** 82,88 ****
      $LYNX $STATUSURL
      ;;
  *)
!     $HTTPD $ARGV
      ERROR=$?
  esac
  
--- 86,92 ----
      $LYNX $STATUSURL
      ;;
  *)
!     $HTTPD $FIRST_ARG $ARGV
      ERROR=$?
  esac
  

Re: apachectl and options take 2

Posted by Justin Erenkrantz <je...@apache.org>.
On Thu, Aug 29, 2002 at 02:31:25PM -0400, Dave Hill wrote:
> Second, despite Aarons reservations..... (no one else responded), this
> change also supports the setting of HTTPD_OPTIONS in the environment,

I don't like the idea of magic environment variables either.

> So..... any reactions to this proposal out there ?
> Anyone want to sponsor this into the tree for me ?

Can you please submit unified diffs (diff -u)?  -- justin

Re: apachectl and options take 2

Posted by Scott Lamb <sl...@slamb.org>.
Dave Hill wrote:
> Hi again,
> 	I am back again with a proposed change to apachectl....
> With the input from Aaron, I reworked my proposed fix/enhancement.
> In a nutshell, for a wide variety of reasons I want apachectl to
> pass -DWARP and other define toggles through to the server invocation.
> Customers like apachectl, and I like giving them example code wrapped in
> <Defined> blocks.

I've got a /etc/init.d/httpd script that reads in /etc/sysconfig/$0 if 
it exists and gets httpd options from there. IMHO a better solution than 
$HTTPD_OPTIONS - your environment does not affect the command's results 
yet you don't need to type stuff every time, and it works with multiple 
instances (I have a restrictive and a relatively permissive server 
configuration). Not submitted to Apache because init scripts are pretty 
system-specific.

-- 
Scott Lamb