Hello community,
here is the log from the commit of package apache2-mod_mono for openSUSE:Factory
checked in at Tue Apr 7 12:42:10 CEST 2009.
--------
--- apache2-mod_mono/apache2-mod_mono.changes 2008-08-26 18:31:26.000000000 +0200
+++ /mounts/work_src_done/STABLE/apache2-mod_mono/apache2-mod_mono.changes 2009-03-31 21:24:19.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Mar 31 13:23:20 MDT 2009 - ajorgensen@novell.com
+
+- Update to 2.4
+ * http://www.mono-project.com/Release_Notes_Mono_2.4
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
mod_mono-2.0.tar.bz2
New:
----
mod_mono-2.4.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ apache2-mod_mono.spec ++++++
--- /var/tmp/diff_new_pack.G23733/_old 2009-04-07 12:04:41.000000000 +0200
+++ /var/tmp/diff_new_pack.G23733/_new 2009-04-07 12:04:41.000000000 +0200
@@ -1,7 +1,7 @@
#
-# spec file for package apache2-mod_mono (Version 2.0)
+# spec file for package apache2-mod_mono (Version 2.4)
#
-# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -29,7 +29,7 @@
License: The Apache Software License
Group: Productivity/Networking/Web/Servers
AutoReqProv: on
-Version: 2.0
+Version: 2.4
Release: 1
Summary: Run ASP.NET Pages on Unix with Apache and Mono
Source: %{modname}-%{version}.tar.bz2
@@ -65,7 +65,10 @@
%setup -n %{modname}-%{version} -q
%build
-%configure
+%if 0%{?sles_version} == 10
+%define _with_remove_display --with-remove-display
+%endif
+%configure %_with_remove_display
make
%install
@@ -81,6 +84,9 @@
%{_mandir}/man8/mod_mono.8*
%changelog
+* Tue Mar 31 2009 ajorgensen@novell.com
+- Update to 2.4
+ * http://www.mono-project.com/Release_Notes_Mono_2.4
* Tue Aug 26 2008 ajorgensen@novell.com
- Update to 2.0 (preview 2)
* Fixes bnc#374272, bnc#392235,
++++++ mod_mono-2.0.tar.bz2 -> mod_mono-2.4.tar.bz2 ++++++
++++ 1875 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mod_mono-2.0/ChangeLog new/mod_mono-2.4/ChangeLog
--- old/mod_mono-2.0/ChangeLog 2008-07-15 19:52:53.000000000 +0200
+++ new/mod_mono-2.4/ChangeLog 2009-03-09 18:02:00.000000000 +0100
@@ -1,3 +1,75 @@
+2009-03-09 Marek Habersack
+
+ * autogen.sh: added support for detecting libtool on Mac, which
+ has it renamed to glibtool in versions 10.5+. Fixes bug #478381
+
+2009-03-08 Marek Habersack
+
+ * configure.in: added detection of glib
+ * mod_mono.8.in: added documentation for the new MonoIOMAP
+ directive.
+ * mod_mono.c (send_entire_file): attempts to map file name using
+ mono_portability_find_file which is able to find files with the
+ same name but different case if MONO_IOMAP is in effect.
+ Added a new directive, MonoIOMAP which takes two parameters - the
+ alias and MONO_IOMAP-style value (all/case/drive). This directive
+ switches MONO_IOMAP on for that alias within mod_mono as well as
+ exports the MONO_IOMAP environment variable in the backend's
+ environment.
+
+ * mono-io-portability.c, mono-io-portability.h: added. Copied from
+ mono runtime and modified for mod_mono purposes.
+
+2009-02-16 Marek Habersack
+
+ * src/mod_mono.c (fork_mod_mono_server): unblock the signals Mono
+ needs (SIGPWR, SIGXCPU, 33, 35) just before executing the
+ backend. It appears that some versions of Apache block signals and
+ Mono uses the above in the runtime and in the GC. As the result of
+ those signals being blocked, the forked backend would lock up as
+ soon as GC would start collecting. Thanks to Zoltan Varga for
+ noticing that the signals are blocked. Fixes bug #472732
+ (mono_execute_request): When a connection attempt fails, do not
+ start the backend immediately but first check if another backend
+ is restarting it. If yes, retry several times to connect to the
+ new backend pausing between attempts. If all connection attempts
+ fail and we've been waiting on another copy of mod_mono to start
+ the backend, make another round (helpful on heavily loaded
+ servers). When we get to the point where we are about to start the
+ backend, do NOT remove the socket file. Doing so introduces a race
+ condition and we can safely assume that the owner of the socket
+ file hasn't change and therefore creating a new socket on top of
+ it will succeed. Fixes bug #472732
+
+2009-01-21 Gonzalo Paniagua Javier
+
+ * src/mod_mono.c: redirect stdout to null when not in debug mode. Now
+ we can write large amounts of text to the console without slowing down
+ mod_mono.
+
+2009-01-08 Marek Habersack
+
+ * configure.in: added the --with-remove-display configure
+ parameter to enable removing of the DISPLAY variable
+ from the mod-mono-server backend's environment. Fixes bug #464225
+
+ * src/mod_mono.c (fork_mod_mono_server): remove the DISPLAY
+ variable from the child process environment if mod_mono was
+ compiled with REMOVE_DISPLAY defined. Fixes bug #464225
+
+2008-10-27 Gonzalo Paniagua Javier
+
+ * src/mod_mono.c: hush warnings.
+
+2008-09-25 Joshua Tauberer
+
+ * src/mod_mono.c: Typo in error message "droping" now "dropping".
+
+2008-09-22 Juraj Skripsky
+
+ * mod_mono.conf.in: Add new file types (as registered in
+ /etc/mono/2.0/web.config).
+
2008-07-14 Joshua Tauberer
* src/mod_mono.c: Always acquire a lock at the start of processing
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mod_mono-2.0/config.in new/mod_mono-2.4/config.in
--- old/mod_mono-2.0/config.in 2008-07-15 19:53:10.000000000 +0200
+++ new/mod_mono-2.4/config.in 2009-03-09 18:02:05.000000000 +0100
@@ -87,6 +87,9 @@
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `unsetenv' function. */
+#undef HAVE_UNSETENV
+
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mod_mono-2.0/configure.in new/mod_mono-2.4/configure.in
--- old/mod_mono-2.0/configure.in 2008-07-15 19:52:53.000000000 +0200
+++ new/mod_mono-2.4/configure.in 2009-03-09 18:02:00.000000000 +0100
@@ -1,5 +1,5 @@
AC_INIT(src/mod_mono.c)
-AM_INIT_AUTOMAKE(mod_mono, 2.0)
+AM_INIT_AUTOMAKE(mod_mono, 2.4)
AM_CONFIG_HEADER(include/mod_mono_config.h:config.in)
AC_PROG_CC
@@ -10,6 +10,23 @@
AC_DEFINE([MODMONO_BIGENDIAN],,[Compiling on a big-endian machine.])
fi
+AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+if test "x$PKG_CONFIG" = "xno"; then
+ AC_MSG_ERROR([You need to install pkg-config])
+fi
+
+PKG_PATH=""
+AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir],
+ if test x$with_crosspkgdir = "x"; then
+ if test -s $PKG_CONFIG_PATH; then
+ PKG_PATH=$PKG_CONFIG_PATH
+ fi
+ else
+ PKG_PATH=$with_crosspkgdir
+ PKG_CONFIG_PATH=$PKG_PATH
+ export PKG_CONFIG_PATH
+ fi
+)
# Checks for header files.
AC_HEADER_SYS_WAIT
@@ -25,7 +42,11 @@
AC_FUNC_FORK
AC_HEADER_STDC
AC_FUNC_SELECT_ARGTYPES
-AC_CHECK_FUNCS([memset mkdir putenv setenv setrlimit select strcasecmp strerror strrchr dup2])
+AC_CHECK_FUNCS([memset mkdir unsetenv putenv setenv setrlimit select strcasecmp strerror strrchr dup2])
+
+GLIB_REQUIRED_VERSION=1.3.11
+
+PKG_CHECK_MODULES(GLIB_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
#
# --enable-debug
@@ -40,6 +61,18 @@
fi
#
+# --with-remove-display
+#
+AC_MSG_CHECKING([whether mod_mono should remove the DISPLAY variable from environment])
+AC_ARG_WITH(remove-display,
+ [ --with-remove-display remove the DISPLAY variable from environment before starting backends],
+ no_display=$withval, no_display=no)
+AC_MSG_RESULT($no_display)
+if test "x$no_display" = "xyes" ; then
+ CFLAGS="$CFLAGS -DREMOVE_DISPLAY"
+fi
+
+#
# --enable-gcov
#
AC_MSG_CHECKING(if gcov compilation was requested)
@@ -341,24 +374,6 @@
CFLAGS="$CFLAGS -DGCOV -O0 -fprofile-arcs -ftest-coverage"
fi
-AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-if test "x$PKG_CONFIG" = "xno"; then
- AC_MSG_ERROR([You need to install pkg-config])
-fi
-
-PKG_PATH=
-AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir],
- if test x$with_crosspkgdir = "x"; then
- if test -s $PKG_CONFIG_PATH; then
- PKG_PATH=$PKG_CONFIG_PATH
- fi
- else
- PKG_PATH=$with_crosspkgdir
- PKG_CONFIG_PATH=$PKG_PATH
- export PKG_CONFIG_PATH
- fi
-)
-
AM_CONDITIONAL(APACHE2, test ! "$APACHE_VER" = "1.3")
if test ! "$APACHE_VER" = "1.3" ; then
dnl Sources are recompiled if we change the target version
@@ -459,6 +474,8 @@
echo " * Profiling enabled = $enable_gprof"
echo " * mono prefix = $MONO_PREFIX"
echo " * Default MonoApplicationsConfigDir = $DFLT_MONO_CONFIG_DIR"
+test "x$no_display" = "xyes" && \
+echo " * DISPLAY variable will be removed before forking the mod-mono-server backend"
dnl echo " * Build old module: $enable_old_module"
echo ""
echo "---"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mod_mono-2.0/COPYING new/mod_mono-2.4/COPYING
--- old/mod_mono-2.0/COPYING 2008-07-15 19:52:53.000000000 +0200
+++ new/mod_mono-2.4/COPYING 2009-03-09 18:02:00.000000000 +0100
@@ -174,3 +174,4 @@
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mod_mono-2.0/man/mod_mono.8.in new/mod_mono-2.4/man/mod_mono.8.in
--- old/mod_mono-2.0/man/mod_mono.8.in 2008-07-15 19:52:53.000000000 +0200
+++ new/mod_mono-2.4/man/mod_mono.8.in 2009-03-09 18:02:00.000000000 +0100
@@ -156,6 +156,16 @@
Takes a string of 'name=value' pairs separated by semicolons. For each
pair, it calls setenv (name, value) before running mod-mono-server.
.TP
+.I "MonoIOMAP"
+Takes alias name and a string of the same format and meaning as the MONO_IOMAP
+environment variable (see the mono(1) manpage). The effect is that mod_mono performs
+the same actions as mono runtime with MONO_IOMAP in effect, as well as that the
+MONO_IOMAP variable with the specified value is exported in the backend environment.
+This option is necessary when you're using MONO_IOMAP in your application and there
+might be static files with mixed case names - in such case mod_mono attempts to open
+the file directly and sends it using apache facilities.
+Default value: none
+.TP
.I "MonoMaxActiveRequests"
The maximum number of concurrent requests mod_mono will pass off to
the ASP.NET backend. Set to zero to turn off the limit. Default value:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mod_mono-2.0/mod_mono.conf.in new/mod_mono-2.4/mod_mono.conf.in
--- old/mod_mono-2.0/mod_mono.conf.in 2008-07-15 19:52:53.000000000 +0200
+++ new/mod_mono-2.4/mod_mono.conf.in 2009-03-09 18:02:00.000000000 +0100
@@ -1,26 +1,36 @@
# mod_mono.conf
-# Acthung! This file may be overwritten
+# Achtung! This file may be overwritten
# Use 'include mod_mono.conf' from other configuration file
# to load mod_mono module.
LoadModule mono_module @APXS_LIBEXECDIR@/mod_mono.so
-
- AddType application/x-asp-net .aspx
- AddType application/x-asp-net .asmx
- AddType application/x-asp-net .ashx
- AddType application/x-asp-net .asax
- AddType application/x-asp-net .ascx
- AddType application/x-asp-net .soap
- AddType application/x-asp-net .rem
- AddType application/x-asp-net .axd
- AddType application/x-asp-net .cs
- AddType application/x-asp-net .config
- AddType application/x-asp-net .Config
- AddType application/x-asp-net .dll
- DirectoryIndex index.aspx
- DirectoryIndex Default.aspx
- DirectoryIndex default.aspx
</IfModule>
+AddType application/x-asp-net .aspx
+AddType application/x-asp-net .asmx
+AddType application/x-asp-net .ashx
+AddType application/x-asp-net .asax
+AddType application/x-asp-net .ascx
+AddType application/x-asp-net .soap
+AddType application/x-asp-net .rem
+AddType application/x-asp-net .axd
+AddType application/x-asp-net .cs
+AddType application/x-asp-net .vb
+AddType application/x-asp-net .master
+AddType application/x-asp-net .sitemap
+AddType application/x-asp-net .resources
+AddType application/x-asp-net .skin
+AddType application/x-asp-net .browser
+AddType application/x-asp-net .webinfo
+AddType application/x-asp-net .resx
+AddType application/x-asp-net .licx
+AddType application/x-asp-net .csproj
+AddType application/x-asp-net .vbproj
+AddType application/x-asp-net .config
+AddType application/x-asp-net .Config
+AddType application/x-asp-net .dll
+DirectoryIndex index.aspx
+DirectoryIndex Default.aspx
+DirectoryIndex default.aspx
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mod_mono-2.0/NEWS new/mod_mono-2.4/NEWS
--- old/mod_mono-2.0/NEWS 2008-07-15 19:52:53.000000000 +0200
+++ new/mod_mono-2.4/NEWS 2009-03-09 18:02:00.000000000 +0100
@@ -50,4 +50,3 @@
process a request or not. You *MUST* use the AddType directive in your
apache configuration file. More info in the INSTALL file.
-
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mod_mono-2.0/src/Makefile.am new/mod_mono-2.4/src/Makefile.am
--- old/mod_mono-2.0/src/Makefile.am 2008-07-15 19:52:53.000000000 +0200
+++ new/mod_mono-2.4/src/Makefile.am 2009-03-09 18:02:00.000000000 +0100
@@ -1,10 +1,10 @@
CLEANFILES = .libs/libmod_mono.so .libs/libmod_mono_old.so *~
lib_LTLIBRARIES = mod_mono.la
-mod_mono_la_SOURCES = mod_mono.c mod_mono.h
-mod_mono_la_LDFLAGS = -module
+mod_mono_la_SOURCES = mod_mono.c mod_mono.h mono-io-portability.c mono-io-portability.h
+mod_mono_la_LDFLAGS = -module $(GLIB_DEPENDENCIES_LIBS)
#/usr/sbin/apxs -c -I../include -I. -D HAVE_CONFIG_H mod_mono.c
-mod_mono_la_CFLAGS = -Wall -DDFLT_MONO_CONFIG_DIR=\"$(DFLT_MONO_CONFIG_DIR)\"
+mod_mono_la_CFLAGS = -Wall -DDFLT_MONO_CONFIG_DIR=\"$(DFLT_MONO_CONFIG_DIR)\" $(GLIB_DEPENDENCIES_CFLAGS)
install: $(lib_LTLIBRARIES)
$(mkinstalldirs) "$(DESTDIR)$(APXS_LIBEXECDIR)"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mod_mono-2.0/src/mod_mono.c new/mod_mono-2.4/src/mod_mono.c
--- old/mod_mono-2.0/src/mod_mono.c 2008-07-15 19:52:53.000000000 +0200
+++ new/mod_mono-2.4/src/mod_mono.c 2009-03-09 18:02:00.000000000 +0100
@@ -33,6 +33,7 @@
#endif
#include "mod_mono.h"
+#include "mono-io-portability.h"
DEFINE_MODULE (mono_module);
@@ -63,6 +64,7 @@
uint32_t handled_requests;
time_t start_time;
char restart_issued;
+ char starting;
int active_requests;
int waiting_requests;
int accepting_requests;
@@ -102,6 +104,7 @@
char *max_memory;
char *debug;
char *env_vars;
+ char *iomap;
char status; /* One of the FORK_* in the enum above.
* Don't care if run_xsp is "false" */
char is_virtual; /* is the server virtual? */
@@ -117,7 +120,8 @@
/* other settings */
unsigned char no_flush;
-
+ int portability_level;
+
#ifndef APACHE13
apr_shm_t *dashboard_shm;
dashboard_data *dashboard;
@@ -356,7 +360,7 @@
#endif
}
-inline static char *
+inline static const char *
apache_get_username ()
{
#ifdef HAVE_UNIXD
@@ -467,6 +471,7 @@
xsp->dashboard->restart_issued = 0;
xsp->dashboard->active_requests = 0;
xsp->dashboard->waiting_requests = 0;
+ xsp->dashboard->starting = 0;
xsp->dashboard->accepting_requests = 1;
}
}
@@ -527,6 +532,8 @@
server->max_memory = NULL;
server->debug = NULL;
server->env_vars = NULL;
+ server->iomap = NULL;
+ server->portability_level = PORTABILITY_UNKNOWN;
server->status = FORK_NONE;
server->is_virtual = is_virtual;
server->start_attempts = "3";
@@ -900,8 +907,11 @@
}
static int
-send_entire_file (request_rec *r, const char *filename, int *result)
+send_entire_file (request_rec *r, const char *filename, int *result, xsp_data *xsp)
{
+ int retval = 0;
+ gchar *file_path = mono_portability_find_file (xsp->portability_level, filename, TRUE);
+
#ifdef APACHE2
# ifdef APR_LARGEFILE
# define MODMONO_LARGE APR_LARGEFILE
@@ -914,18 +924,20 @@
apr_size_t nbytes;
const apr_int32_t flags = APR_READ | APR_SENDFILE_ENABLED | MODMONO_LARGE;
- st = apr_file_open (&file, filename, flags, APR_OS_DEFAULT, r->pool);
+ st = apr_file_open (&file, file_path ? file_path : filename, flags, APR_OS_DEFAULT, r->pool);
if (st != APR_SUCCESS) {
- DEBUG_PRINT (1, "file_open FAILED");
+ DEBUG_PRINT (1, "file_open FAILED (path: %s)", file_path ? file_path : filename);
*result = HTTP_FORBIDDEN;
- return -1;
+ retval = -1;
+ goto finish;
}
st = apr_file_info_get (&info, APR_FINFO_SIZE, file);
if (st != APR_SUCCESS) {
DEBUG_PRINT (1, "info_get FAILED");
*result = HTTP_FORBIDDEN;
- return -1;
+ retval = -1;
+ goto finish;
}
st = ap_send_fd (file, r, 0, info.size, &nbytes);
@@ -933,29 +945,33 @@
if (nbytes < 0) {
DEBUG_PRINT (1, "SEND FAILED");
*result = HTTP_INTERNAL_SERVER_ERROR;
- return -1;
+ retval = -1;
+ goto finish;
}
-
- return 0;
#else
FILE *fp;
- fp = fopen (filename, "rb");
+ fp = fopen (file_path ? file_path : filename, "rb");
if (fp == NULL) {
- DEBUG_PRINT (1, "file_open FAILED");
+ DEBUG_PRINT (1, "file_open FAILED (path: %s)", file_path ? file_path : filename);
*result = HTTP_FORBIDDEN;
- return -1;
+ retval = -1;
+ goto finish;
}
if (ap_send_fd (fp, r) < 0) {
fclose (fp);
*result = HTTP_INTERNAL_SERVER_ERROR;
- return -1;
+ retval = -1;
+ goto finish;
}
-
+
fclose (fp);
- return 0;
#endif
+ finish:
+ if (file_path)
+ g_free (file_path);
+ return retval;
}
static int
@@ -1179,7 +1195,7 @@
status = -1;
break;
}
- status = send_entire_file (r, str, result);
+ status = send_entire_file (r, str, result, xsp);
if (status == -1)
error_message = "failed to send file (file data)";
break;
@@ -1496,6 +1512,19 @@
}
static void
+set_null_stdout ()
+{
+#ifndef WIN32
+ int fd;
+
+ fd = open ("/dev/null", O_WRONLY);
+ if (fd >= 0) {
+ dup2 (fd, 1);
+ }
+#endif
+}
+
+static void
fork_mod_mono_server (apr_pool_t *pool, xsp_data *config)
{
pid_t pid;
@@ -1511,6 +1540,7 @@
int max_cpu_time = 0;
int status;
char is_master;
+ sigset_t sigset;
#if defined (APR_HAS_USER)
apr_uid_t cur_uid;
apr_gid_t cur_gid;
@@ -1578,6 +1608,9 @@
set_environment_variables (pool, config->env_vars);
+ if (config->iomap && *config->iomap)
+ SETENV (pool, "MONO_IOMAP", config->iomap);
+
pid = fork ();
if (pid > 0) {
wait (&status);
@@ -1590,7 +1623,7 @@
exit (0);
setsid ();
- chdir ("/");
+ status = chdir ("/");
#if defined (APR_HAS_USER)
/*
@@ -1627,6 +1660,8 @@
#ifdef DEBUG
dup2 (2, 1);
+#else
+ set_null_stdout ();
#endif
for (i = getdtablesize () - 1; i >= 3; i--)
close (i);
@@ -1659,6 +1694,14 @@
if (config->debug && !strcasecmp (config->debug, "True"))
SETENV (pool, "MONO_OPTIONS", "--debug");
+#ifdef REMOVE_DISPLAY
+#warning mod_mono is compiled with support for removing the DISPLAY variable (Bug 464225)
+#ifdef HAVE_UNSETENV
+ unsetenv ("DISPLAY");
+#else
+#warning unsetenv (2) is not available!
+#endif
+#endif
memset (argv, 0, sizeof (char *) * MAXARGS);
argi = 0;
argv [argi++] = config->server_path;
@@ -1720,6 +1763,14 @@
argv [5], argv [6], argv [7], argv [8],
argv [9], argv [10], argv [11], argv [12]);
+ /* Unblock signals Mono uses: see bug #472732 */
+ sigemptyset (&sigset);
+ sigaddset (&sigset, SIGPWR);
+ sigaddset (&sigset, SIGXCPU);
+ sigaddset (&sigset, 33);
+ sigaddset (&sigset, 35);
+ sigprocmask (SIG_UNBLOCK, &sigset, NULL);
+
execv (argv [0], argv);
ap_log_error (APLOG_MARK, APLOG_ERR, STATUS_AND_SERVER,
"Failed running '%s %s %s %s %s %s %s %s %s %s %s %s %s'. Reason: %s",
@@ -2071,7 +2122,7 @@
// request.
if (rv == APR_SUCCESS && conf->dashboard->active_requests >= max_active_requests) {
ap_log_error (APLOG_MARK, APLOG_ERR, STATUS_AND_SERVER,
- "Maximum number (%d) of concurrent mod_mono requests to %s reached. Droping request.",
+ "Maximum number (%d) of concurrent mod_mono requests to %s reached. Dropping request.",
max_active_requests, conf->dashboard_lock_file);
return 0;
}
@@ -2132,13 +2183,14 @@
int connect_attempts;
int start_wait_time;
char *socket_name = NULL;
-
+ int retrying, was_starting;
+
config = ap_get_module_config (r->server->module_config, &mono_module);
- DEBUG_PRINT (2, "config = 0x%lx", (uint64_t) config);
+ DEBUG_PRINT (2, "config = 0x%p", config);
if (r->per_dir_config != NULL)
dir_config = ap_get_module_config (r->per_dir_config, &mono_module);
- DEBUG_PRINT (2, "dir_config = 0x%lx", (uint64_t) dir_config);
+ DEBUG_PRINT (2, "dir_config = 0x%p", dir_config);
if (dir_config != NULL && dir_config->alias != NULL)
idx = search_for_alias (dir_config->alias, config);
else
@@ -2211,9 +2263,17 @@
}
}
#endif
-
+ if (conf->portability_level > PORTABILITY_MAX)
+ conf->portability_level = PORTABILITY_UNKNOWN;
+
+ mono_portability_helpers_init (&conf->portability_level, conf->iomap);
+
rv = -1; /* avoid a warning about uninitialized value */
+#ifndef APACHE13
+ retrying = connect_attempts;
+ was_starting = 0;
+#endif
while (connect_attempts--) {
rv = setup_socket (&sock, conf, r->pool);
DEBUG_PRINT (2, "After setup_socket");
@@ -2239,12 +2299,37 @@
decrement_active_requests (conf);
return HTTP_SERVICE_UNAVAILABLE;
}
+
+ if (conf->dashboard->starting) {
+ retrying--;
+ was_starting = 1;
+
+ rv2 = apr_global_mutex_unlock (conf->dashboard_mutex);
+ if (rv2 != APR_SUCCESS)
+ ap_log_error (APLOG_MARK, APLOG_ALERT, STATCODE_AND_SERVER (rv2),
+ "Failed to release %s lock, the process may deadlock!",
+ conf->dashboard_lock_file);
+ if (retrying < 0) {
+ ap_log_error (APLOG_MARK, APLOG_CRIT, STATUS_AND_SERVER,
+ "Another process is attempting to start the backend. This request will fail.");
+ decrement_active_requests (conf);
+ return HTTP_SERVICE_UNAVAILABLE;
+ }
+ connect_attempts++; /* keep trying */
+ apr_sleep (apr_time_from_sec (start_wait_time));
+ continue;
+ }
#endif
-
- if (socket_name != NULL && unlink (socket_name) < 0 && errno != ENOENT)
- ap_log_error (APLOG_MARK, APLOG_ALERT, STATUS_AND_SERVER,
- "Could not remove stale socket %s. %s. Further requests will probably fail.",
- socket_name, strerror (errno));
+
+ if (was_starting) {
+ was_starting = 0;
+ connect_attempts++;
+
+ /* let's try one more time here */
+ apr_sleep (apr_time_from_sec (start_wait_time));
+ continue;
+ }
+
start_xsp (config, 0, conf->alias);
/* give some time for warm-up */
DEBUG_PRINT (2, "Started new backend, sleeping %us to let it configure", (unsigned)start_wait_time);
@@ -2479,6 +2564,9 @@
#ifdef APACHE13
sock = apr_pcalloc (pconf, sizeof (apr_socket_t));
+#else
+ if (xsp->dashboard)
+ xsp->dashboard->starting = 1;
#endif
rv = setup_socket (&sock, xsp, pconf);
@@ -2509,6 +2597,10 @@
}
#endif
}
+#ifndef APACHE13
+ if (xsp->dashboard)
+ xsp->dashboard->starting = 0;
+#endif
}
}
@@ -2992,6 +3084,10 @@
" Default value: Default: \"\""
),
+ MAKE_CMD12 (MonoIOMAP, iomap,
+ "A string with format the same as the MONO_IOMAP variable (see mod_mono (1))."
+ " Default value: none"),
+
MAKE_CMD_ITERATE2 (AddMonoApplications, applications,
"Appends an application."
),
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mod_mono-2.0/src/mono-io-portability.c new/mod_mono-2.4/src/mono-io-portability.c
--- old/mod_mono-2.0/src/mono-io-portability.c 1970-01-01 01:00:00.000000000 +0100
+++ new/mod_mono-2.4/src/mono-io-portability.c 2009-03-09 18:02:00.000000000 +0100
@@ -0,0 +1,259 @@
+#ifdef HAVE_CONFIG_H
+#include "mod_mono_config.h"
+#endif
+
+#include
+#include
+#include
+#include
+#include "mono-io-portability.h"
+
+#include
+
+#define IS_PORTABILITY_NONE (portability_level & PORTABILITY_NONE)
+#define IS_PORTABILITY_UNKNOWN (portability_level & PORTABILITY_UNKNOWN)
+#define IS_PORTABILITY_DRIVE (portability_level & PORTABILITY_DRIVE)
+#define IS_PORTABILITY_CASE (portability_level & PORTABILITY_CASE)
+#define IS_PORTABILITY_SET (portability_level > 0)
+
+void mono_portability_helpers_init (int *portability_level, char *env)
+{
+ if (!portability_level || *portability_level != PORTABILITY_UNKNOWN || !env || !*env)
+ return;
+
+ *portability_level = PORTABILITY_NONE;
+
+ if (env != NULL) {
+ /* parse the environment setting and set up some vars
+ * here
+ */
+ gchar **options = g_strsplit (env, ":", 0);
+ int i;
+
+ if (options == NULL) {
+ /* This shouldn't happen */
+ return;
+ }
+
+ for (i = 0; options[i] != NULL; i++) {
+ if (!strncasecmp (options[i], "drive", 5)) {
+ *portability_level |= PORTABILITY_DRIVE;
+ } else if (!strncasecmp (options[i], "case", 4)) {
+ *portability_level |= PORTABILITY_CASE;
+ } else if (!strncasecmp (options[i], "all", 3)) {
+ *portability_level |= (PORTABILITY_DRIVE |
+ PORTABILITY_CASE);
+ }
+ }
+ }
+}
+
+/* Returns newly allocated string, or NULL on failure */
+static gchar *find_in_dir (DIR *current, const gchar *name)
+{
+ struct dirent *entry;
+
+ while((entry = readdir (current)) != NULL) {
+ if (!g_ascii_strcasecmp (name, entry->d_name)) {
+ char *ret;
+
+ ret = g_strdup (entry->d_name);
+ closedir (current);
+ return ret;
+ }
+ }
+
+ closedir (current);
+
+ return(NULL);
+}
+
+/* Returns newly-allocated string or NULL on failure */
+gchar *mono_portability_find_file (int portability_level, const gchar *pathname, gboolean last_exists)
+{
+ gchar *new_pathname, **components, **new_components;
+ int num_components = 0, component = 0;
+ DIR *scanning = NULL;
+ size_t len;
+
+ if (IS_PORTABILITY_NONE) {
+ return(NULL);
+ }
+
+ new_pathname = g_strdup (pathname);
+
+ if (last_exists &&
+ access (new_pathname, F_OK) == 0) {
+ return(new_pathname);
+ }
+
+ /* First turn '\' into '/' and strip any drive letters */
+ g_strdelimit (new_pathname, "\\", '/');
+
+ if (IS_PORTABILITY_DRIVE &&
+ g_ascii_isalpha (new_pathname[0]) &&
+ (new_pathname[1] == ':')) {
+ int len = strlen (new_pathname);
+
+ g_memmove (new_pathname, new_pathname+2, len - 2);
+ new_pathname[len - 2] = '\0';
+
+ }
+
+ len = strlen (new_pathname);
+ if (len > 1 && new_pathname [len - 1] == '/') {
+ new_pathname [len - 1] = 0;
+ }
+
+ if (last_exists &&
+ access (new_pathname, F_OK) == 0) {
+ return(new_pathname);
+ }
+
+ /* OK, have to work harder. Take each path component in turn
+ * and do a case-insensitive directory scan for it
+ */
+
+ if (!(IS_PORTABILITY_CASE)) {
+ g_free (new_pathname);
+ return(NULL);
+ }
+
+ components = g_strsplit (new_pathname, "/", 0);
+ if (components == NULL) {
+ /* This shouldn't happen */
+ g_free (new_pathname);
+ return(NULL);
+ }
+
+ while(components[num_components] != NULL) {
+ num_components++;
+ }
+ g_free (new_pathname);
+
+ if (num_components == 0){
+ return NULL;
+ }
+
+
+ new_components = (gchar **)g_new0 (gchar **, num_components + 1);
+
+ if (num_components > 1) {
+ if (strcmp (components[0], "") == 0) {
+ /* first component blank, so start at / */
+ scanning = opendir ("/");
+ if (scanning == NULL) {
+ g_strfreev (new_components);
+ g_strfreev (components);
+ return(NULL);
+ }
+
+ new_components[component++] = g_strdup ("");
+ } else {
+ DIR *current;
+ gchar *entry;
+
+ current = opendir (".");
+ if (current == NULL) {
+ g_strfreev (new_components);
+ g_strfreev (components);
+ return(NULL);
+ }
+
+ entry = find_in_dir (current, components[0]);
+ if (entry == NULL) {
+ g_strfreev (new_components);
+ g_strfreev (components);
+ return(NULL);
+ }
+
+ scanning = opendir (entry);
+ if (scanning == NULL) {
+ g_free (entry);
+ g_strfreev (new_components);
+ g_strfreev (components);
+ return(NULL);
+ }
+
+ new_components[component++] = entry;
+ }
+ } else {
+ if (last_exists) {
+ if (strcmp (components[0], "") == 0) {
+ /* First and only component blank */
+ new_components[component++] = g_strdup ("");
+ } else {
+ DIR *current;
+ gchar *entry;
+
+ current = opendir (".");
+ if (current == NULL) {
+ g_strfreev (new_components);
+ g_strfreev (components);
+ return(NULL);
+ }
+
+ entry = find_in_dir (current, components[0]);
+ if (entry == NULL) {
+ g_strfreev (new_components);
+ g_strfreev (components);
+ return(NULL);
+ }
+
+ new_components[component++] = entry;
+ }
+ } else {
+ new_components[component++] = g_strdup (components[0]);
+ }
+ }
+
+ g_assert (component == 1);
+
+ for(; component < num_components; component++) {
+ gchar *entry;
+ gchar *path_so_far;
+
+ if (!last_exists &&
+ component == num_components -1) {
+ entry = g_strdup (components[component]);
+ closedir (scanning);
+ } else {
+ entry = find_in_dir (scanning, components[component]);
+ if (entry == NULL) {
+ g_strfreev (new_components);
+ g_strfreev (components);
+ return(NULL);
+ }
+ }
+
+ new_components[component] = entry;
+
+ if (component < num_components -1) {
+ path_so_far = g_strjoinv ("/", new_components);
+
+ scanning = opendir (path_so_far);
+ g_free (path_so_far);
+ if (scanning == NULL) {
+ g_strfreev (new_components);
+ g_strfreev (components);
+ return(NULL);
+ }
+ }
+ }
+
+ g_strfreev (components);
+
+ new_pathname = g_strjoinv ("/", new_components);
+
+ g_strfreev (new_components);
+
+ if ((last_exists &&
+ access (new_pathname, F_OK) == 0) ||
+ (!last_exists)) {
+ return(new_pathname);
+ }
+
+ g_free (new_pathname);
+ return(NULL);
+}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mod_mono-2.0/src/mono-io-portability.h new/mod_mono-2.4/src/mono-io-portability.h
--- old/mod_mono-2.0/src/mono-io-portability.h 1970-01-01 01:00:00.000000000 +0100
+++ new/mod_mono-2.4/src/mono-io-portability.h 2009-03-09 18:02:00.000000000 +0100
@@ -0,0 +1,18 @@
+#ifndef __MONO_IO_PORTABILITY_H
+#define __MONO_IO_PORTABILITY_H
+
+#include
+#include "mod_mono.h"
+
+enum {
+ PORTABILITY_NONE = 0x00,
+ PORTABILITY_UNKNOWN = 0x01,
+ PORTABILITY_DRIVE = 0x02,
+ PORTABILITY_CASE = 0x04,
+ PORTABILITY_MAX = 0x07
+};
+
+void mono_portability_helpers_init (int *portability_level, char *env);
+gchar *mono_portability_find_file (int portability_level, const gchar *pathname, gboolean last_exists);
+
+#endif
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org