From 7dc8e9bfabb8ab5f67aadf91a615099eba22d503 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 15 Dec 2001 13:56:36 +0000 Subject: [PATCH] Move any load library path environment variables out of apachectl and into a separate environment variable file which can be more easily tailored by the admin. The environment variable file as built by Apache may have additional system- specific settings. For example, on OS/390 we tailor the heap settings to allow lots of threads. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92490 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ Makefile.in | 6 ++++++ configure.in | 16 +++++++++++++++- support/.cvsignore | 1 + support/Makefile.in | 6 ++++++ support/apachectl.in | 12 ++++++------ support/envvars-std.in | 10 ++++++++++ 7 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 support/envvars-std.in diff --git a/CHANGES b/CHANGES index 202f2f0c2e..2cab29bdeb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with Apache 2.0.30-dev + *) Move any load library path environment variables out of + apachectl and into a separate environment variable file which + can be more easily tailored by the admin. The environment + variable file as built by Apache may have additional system- + specific settings. For example, on OS/390 we tailor the heap + settings to allow lots of threads. [Jeff Trawick] + *) Use the new APR pool code to reduce pool-related lock contention in the worker MPM. [Sander Striker] diff --git a/Makefile.in b/Makefile.in index b04fed64d0..4a9ec2cad6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -76,6 +76,12 @@ install-conf: $(INSTALL_DATA) $(sysconfdir)/$$i $(sysconfdir)/$$file; \ fi; \ done + @if test -f "$(builddir)/envvars-std"; then \ + cp -p envvars-std $(sbindir); \ + if test ! -f $(sbindir)/envvars; then \ + cp -p envvars-std $(sbindir)/envvars ; \ + fi ; \ + fi install-build: @echo Installing build system files diff --git a/configure.in b/configure.in index 1cb32b5bd9..806b60eb31 100644 --- a/configure.in +++ b/configure.in @@ -240,6 +240,19 @@ initgroups \ bindprocessor \ ) +dnl ## Set up any appropriate OS-specific environment variables for apachectl + +case $host in + *aix*) + OS_SPECIFIC_VARS="set LDR_CNTRL=\"MAXDATA=0x80000000\" ; export LDR_CNTRL ; set AIXTHREAD_SCOPE=S ; export AIXTHREAD_SCOPE" + ;; + *os390*) + OS_SPECIFIC_VARS="export _CEE_RUNOPTS=\"(STACK(,,ANY))\" ; export _EDC_ADD_ERRNO2=1" + ;; + *) + OS_SPECIFIC_VARS="" +esac + AC_ARG_WITH(port,APACHE_HELP_STRING(--with-port=PORT,Port on which to listen (default is 80)), [if test "$withval" = "yes"; then AC_MSG_ERROR('option --with-port requires a value (the TCP port number)'); else PORT="$withval"; fi], [PORT=80]) @@ -262,6 +275,7 @@ APACHE_SUBST(OS) APACHE_SUBST(OS_DIR) APACHE_SUBST(BUILTIN_LIBS) APACHE_SUBST(SHLIBPATH_VAR) +APACHE_SUBST(OS_SPECIFIC_VARS) PRE_SHARED_CMDS='echo ""' POST_SHARED_CMDS='echo ""' @@ -437,7 +451,7 @@ case $host in ;; esac -AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs support/apachectl support/dbmmanage support/log_server_status support/logresolve.pl support/phf_abuse_log.cgi support/split-logfile build/rules.mk,,[ +AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs support/apachectl support/dbmmanage support/envvars-std support/log_server_status support/logresolve.pl support/phf_abuse_log.cgi support/split-logfile build/rules.mk,,[ APACHE_GEN_MAKEFILES ]) diff --git a/support/.cvsignore b/support/.cvsignore index 8913cde771..0743b4f5e0 100644 --- a/support/.cvsignore +++ b/support/.cvsignore @@ -18,6 +18,7 @@ Release apachectl checkgid dbmmanage +envvars-std log_server_status logresolve.pl split-logfile diff --git a/support/Makefile.in b/support/Makefile.in index c3475bf1fa..8f34369d24 100644 --- a/support/Makefile.in +++ b/support/Makefile.in @@ -21,6 +21,12 @@ install: chmod 755 $(sbindir)/$$i; \ fi ; \ done + @if test -f "$(builddir)/envvars-std"; then \ + cp -p envvars-std $(sbindir); \ + if test ! -f $(sbindir)/envvars; then \ + cp -p envvars-std $(sbindir)/envvars ; \ + fi ; \ + fi htpasswd_OBJECTS = htpasswd.lo htpasswd: $(htpasswd_OBJECTS) diff --git a/support/apachectl.in b/support/apachectl.in index e948f91712..b1cbb51be0 100644 --- a/support/apachectl.in +++ b/support/apachectl.in @@ -20,6 +20,7 @@ # When multiple arguments are given, only the error from the _last_ # one is reported. Run "apachectl help" for usage info # +ARGV="$@" # # |||||||||||||||||||| START CONFIGURATION SECTION |||||||||||||||||||| # -------------------- -------------------- @@ -30,10 +31,10 @@ PIDFILE=@prefix@/logs/@progname@.pid # the path to your httpd binary, including options if necessary HTTPD='@prefix@/bin/@progname@' # -# the following lines are automatically uncommented for -# binary builds -#binbuild @SHLIBPATH_VAR@='@prefix@/lib/:$@SHLIBPATH_VAR@' -#binbuild export @SHLIBPATH_VAR@ +# pick up any necessary environment variables +if test -f @prefix@/bin/envvars; then + . @prefix@/bin/envvars +fi # # a command that outputs a formatted text version of the HTML at the # url given on the command line. Designed for lynx, however other @@ -48,12 +49,11 @@ STATUSURL="http://localhost:@PORT@/server-status" # |||||||||||||||||||| END CONFIGURATION SECTION |||||||||||||||||||| ERROR=0 -ARGV="$@" if [ "x$ARGV" = "x" ] ; then ARGS="help" fi -for ARG in $@ $ARGS +for ARG in $ARGV $ARGS do # check for pidfile if [ -f $PIDFILE ] ; then diff --git a/support/envvars-std.in b/support/envvars-std.in new file mode 100644 index 0000000000..37a8606278 --- /dev/null +++ b/support/envvars-std.in @@ -0,0 +1,10 @@ +# envvars-std - default environment variables for apachectl +# +# This file is generated from envvars-std.in +# +# the following lines are automatically uncommented for +# binary builds +#binbuild @SHLIBPATH_VAR@='@prefix@/lib/:$@SHLIBPATH_VAR@' +#binbuild export @SHLIBPATH_VAR@ +# +@OS_SPECIFIC_VARS@ -- 2.50.1