[389-devel] Please review: allow use of Apache without threading support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>From 928e651912e93202deeb46d203c5cdd794325b84 Mon Sep 17 00:00:00 2001
From: Rich Megginson <rmeggins@xxxxxxxxxx>
Date: Thu, 8 Oct 2009 18:51:47 -0600
Subject: [PATCH] Allow use of unthreaded Apache
 Allow the use of an Apache without threading support.  The mod_admserv
 authorization cache will not work correctly without threading support.
 This means that most Console and Admin Server tasks will fail if the
 configuration directory server is not available.  If an Apache without
 threading is found, configure will print an error and abort.  You can
 force the use of an unthreaded Apache by using the --disable-threading
 configure option.  Example:
  configure --with-httpd=/usr/sbin/httpd # non-threaded
  ...
  checking for /usr/sbin/httpd with threading support... configure: error: threading model not supported - use --disable-threading to force use of unthreaded model
  configure aborts
 Threading explicitly disabled:
  configure --disable-threading --with-httpd=/usr/sbin/httpd # non-threaded
  ...
  checking for --enable-threading... no
  checking for /usr/sbin/httpd with threading support... NOTICE - threading support explicitly disabled - Admin Server authorization cache will not work correctly
  ...
 configure detects that /usr/sbin/httpd does not use the Worker model (that
 is, threading support) and prints a warning.

Also fix some minor compilation warnings.
---
 configure                    |   94 +++++++++++++++++++++++++++++------------
 lib/libdsa/dsalib_location.c |    1 +
 m4/httpd.m4                  |   25 +++++++++++
 mod_admserv/mod_admserv.c    |   11 +++--
 4 files changed, 98 insertions(+), 33 deletions(-)

diff --git a/lib/libdsa/dsalib_location.c b/lib/libdsa/dsalib_location.c
index 9237cd9..8cccd0f 100644
--- a/lib/libdsa/dsalib_location.c
+++ b/lib/libdsa/dsalib_location.c
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <ctype.h>
 #include "nspr.h"
 #include "plstr.h"
 
diff --git a/m4/httpd.m4 b/m4/httpd.m4
index f7d1991..03a52a2 100644
--- a/m4/httpd.m4
+++ b/m4/httpd.m4
@@ -75,6 +75,31 @@ if test ! -f $httpdconfdir/mime.types ; then
     fi
 fi
 
+if test -z "$enable_threading" ; then
+   enable_threading=yes # if not set on cmdline, set default
+fi
+AC_MSG_CHECKING(for --enable-threading)
+AC_ARG_ENABLE(threading,
+              AS_HELP_STRING([--enable-threading],
+                             [Admin Server works best if Apache has threading support.  Use --disable-threading to force the use of an Apache without threading support.]))
+AC_MSG_RESULT($enable_threading)
+
+# check for worker model
+AC_MSG_CHECKING(for $HTTPD with threading support)
+httpd_model=`$HTTPD -V | grep "Server MPM:" | awk '{print $3}'`
+if test "$httpd_model" = Worker ; then
+    AC_MSG_RESULT([good - threading model is supported])
+else
+    httpd_model=`$HTTPD -V | grep "threaded:" | awk '{print $2}'`
+    if test "$httpd_model" = yes ; then
+        AC_MSG_RESULT([good - threading model is supported])
+    elif test "$enable_threading" = yes ; then
+        AC_MSG_ERROR([threading model not supported - use --disable-threading to force use of unthreaded model])
+    else
+        AC_MSG_RESULT([NOTICE - threading support explicitly disabled - Admin Server authorization cache will not work correctly])
+    fi
+fi
+
 # check for --with-apxs
 AC_MSG_CHECKING(for --with-apxs)
 AC_ARG_WITH(apxs,
diff --git a/mod_admserv/mod_admserv.c b/mod_admserv/mod_admserv.c
index a70420b..d3a659a 100644
--- a/mod_admserv/mod_admserv.c
+++ b/mod_admserv/mod_admserv.c
@@ -647,7 +647,7 @@ static int password_pipe(request_rec *r)
     apr_file_write(writep, ans, &nbytes);
 
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL,
-                 "password_pipe(): wrote %d bytes");
+                 "password_pipe(): wrote %d bytes", (int)nbytes);
 
     /* Close the writing side, we don't need this any more */
     apr_file_close(writep);
@@ -2889,7 +2889,7 @@ static int fixup_admin_server_header(request_rec *r)
      * be set in admserv.conf (or httpd.conf)
      */
     if (!string) {
-#define ADMSERV_VERSION_STRING "Fedora-Administrator/1.0"
+#define ADMSERV_VERSION_STRING "389-Administrator/1.0"
         string = ADMSERV_VERSION_STRING;
     }
     apr_table_setn(r->headers_out, "Admin-Server", string);
@@ -2916,9 +2916,10 @@ static int mod_admserv_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
     ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded);
 
     if (threaded != 1) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, 0 /* status */, NULL,
-            "This module only supports the threaded MPM");
-        exit(1);
+        ap_log_error(APLOG_MARK, APLOG_NOTICE, 0 /* status */, NULL,
+                     "Not using a threaded server.  The Admin Server authorization cache "
+                     "will not work correctly.  Console and Admin Server tasks will "
+                     "be disabled if the configuration directory server is not available.");
     }
 
     return OK;
-- 
1.5.5.6

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

--
389-devel mailing list
389-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-devel

[Index of Archives]     [Fedora Directory Announce]     [Fedora Users]     [Older Fedora Users Mail]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Review]     [Fedora Art]     [Fedora Music]     [Fedora Packaging]     [CentOS]     [Fedora SELinux]     [Big List of Linux Books]     [KDE Users]     [Fedora Art]     [Fedora Docs]

  Powered by Linux