Author: baggins Date: Mon Mar 28 12:20:08 2011 GMT Module: packages Tag: HEAD ---- Log message: - rel 8 - configurable shm mutex mech to solve interoperability problems with mod_ruid2
---- Files affected: packages/apache-mod_watch: apache-mod_watch.conf (1.4 -> 1.5) , apache-mod_watch.spec (1.36 -> 1.37) , apache-mod_watch-mutex.patch (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: packages/apache-mod_watch/apache-mod_watch.conf diff -u packages/apache-mod_watch/apache-mod_watch.conf:1.4 packages/apache-mod_watch/apache-mod_watch.conf:1.5 --- packages/apache-mod_watch/apache-mod_watch.conf:1.4 Sat Nov 20 18:44:15 2004 +++ packages/apache-mod_watch/apache-mod_watch.conf Mon Mar 28 14:20:03 2011 @@ -3,6 +3,13 @@ LoadModule watch_module modules/mod_watch.so <IfModule mod_watch.c> + # The mechanism to use for the shared memory lock, useful to solve + # interoperability problems with modules like ruid2 + # If you see a lot of '(20014)Internal error: shGetLockedEntry(...' + # try changing this option to file/fcntl/flock + # Valid mechanisms are: default, file, flock, fcntl, pthread + #WatchMutexMech file + # Allows the URL used to query virtual host data: # # http://your.pld.machine/watch-info ================================================================ Index: packages/apache-mod_watch/apache-mod_watch.spec diff -u packages/apache-mod_watch/apache-mod_watch.spec:1.36 packages/apache-mod_watch/apache-mod_watch.spec:1.37 --- packages/apache-mod_watch/apache-mod_watch.spec:1.36 Thu Mar 10 19:30:18 2011 +++ packages/apache-mod_watch/apache-mod_watch.spec Mon Mar 28 14:20:03 2011 @@ -8,7 +8,7 @@ Summary(pl.UTF-8): Moduł do apache: Interfejs do monitorowania za pomocą MRTG Name: apache-mod_%{mod_name} Version: 4.03 -Release: 7 +Release: 8 License: BSD Group: Networking/Daemons/HTTP Source0: http://www.snert.com/Software/download/mod_watch%(echo %{version} | tr -d .).tgz @@ -16,6 +16,7 @@ Source1: %{name}.conf Patch0: %{name}-apr-fix.patch Patch1: %{name}-shm-fix.patch +Patch2: %{name}-mutex.patch URL: http://www.snert.com/Software/mod_watch/ BuildRequires: %{apxs} BuildRequires: apache-devel >= 2.0.52-2 @@ -48,6 +49,7 @@ %setup -q -n mod_%{mod_name}-4.3 %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %{__make} -f Makefile.dso build \ @@ -85,6 +87,10 @@ All persons listed below can be reached at <cvs_login>@pld-linux.org $Log$ +Revision 1.37 2011/03/28 12:20:03 baggins +- rel 8 +- configurable shm mutex mech to solve interoperability problems with mod_ruid2 + Revision 1.36 2011/03/10 18:30:18 baggins - rel 7 - fix for "Internal error: shGetLockedEntry", see http://ovcharov.me/2009/09/01/kak-pochinit-mod_watch/ ================================================================ Index: packages/apache-mod_watch/apache-mod_watch-mutex.patch diff -u /dev/null packages/apache-mod_watch/apache-mod_watch-mutex.patch:1.1 --- /dev/null Mon Mar 28 14:20:09 2011 +++ packages/apache-mod_watch/apache-mod_watch-mutex.patch Mon Mar 28 14:20:03 2011 @@ -0,0 +1,112 @@ +diff -ur mod_watch-4.3/mod_watch.c mod_watch-4.3-mutex/mod_watch.c +--- mod_watch-4.3/mod_watch.c 2011-03-28 14:15:48.017826697 +0200 ++++ mod_watch-4.3-mutex/mod_watch.c 2011-03-28 14:07:07.613894883 +0200 +@@ -1466,6 +1466,63 @@ + } + + /* ++ * WatchMutexMech directory ++ * ++ * Mutex mechanism to use for shared memory lock. ++ */ ++static const char * ++WatchMutexMech(cmd_parms *cmd, void *dconf, const char *mech) ++{ ++ if (!strcasecmp(mech, "default")) { ++ shMutexMech = APR_LOCK_DEFAULT; ++ } ++#if APR_HAS_FCNTL_SERIALIZE ++ else if (!strcasecmp(mech, "fcntl") || !strcasecmp(mech, "file")) { ++ shMutexMech = APR_LOCK_FCNTL; ++ } ++#endif ++#if APR_HAS_FLOCK_SERIALIZE ++ else if (!strcasecmp(mech, "flock") || !strcasecmp(mech, "file")) { ++ shMutexMech = APR_LOCK_FLOCK; ++ } ++#endif ++#if APR_HAS_POSIXSEM_SERIALIZE ++ else if (!strcasecmp(mech, "posixsem") || !strcasecmp(mech, "sem")) { ++ shMutexMech = APR_LOCK_POSIXSEM; ++ } ++#endif ++#if APR_HAS_PROC_PTHREAD_SERIALIZE ++ else if (!strcasecmp(mech, "pthread")) { ++ shMutexMech = APR_LOCK_PROC_PTHREAD; ++ } ++#endif ++ else { ++ return apr_pstrcat(cmd->pool, "Invalid WatchMutexMech argument ", mech, ++ " (Valid WatchMutexMech mechanisms are: default" ++#if APR_HAS_FLOCK_SERIALIZE || APR_HAS_FCNTL_SERIALIZE ++ ", file" ++#endif ++#if APR_HAS_FLOCK_SERIALIZE ++ ", flock" ++#endif ++#if APR_HAS_FCNTL_SERIALIZE ++ ", fcntl" ++#endif ++#if APR_HAS_POSIXSEM_SERIALIZE ++ ", sem" ++#endif ++#if APR_HAS_POSIXSEM_SERIALIZE ++ ", posixsem" ++#endif ++#if APR_HAS_PROC_PTHREAD_SERIALIZE ++ ", pthread" ++#endif ++ ")", NULL); ++ } ++ return (const char *) 0; ++} ++ ++/* + * WatchStateDirectory directory + * + * Absolute or server root relative directory where support and runtime +@@ -1645,6 +1702,11 @@ + ), + + AP_INIT_TAKE1( ++ "WatchMutexMech", WatchMutexMech, NULL, RSRC_CONF, ++ "Mutex mechanism to use for shared memory lock." ++ ), ++ ++ AP_INIT_TAKE1( + "WatchStateDirectory", WatchStateDirectory, NULL, RSRC_CONF, + "Spool directory for any support and runtime files." + ), +diff -ur mod_watch-4.3/SharedHash.c mod_watch-4.3-mutex/SharedHash.c +--- mod_watch-4.3/SharedHash.c 2011-03-28 14:15:48.017826697 +0200 ++++ mod_watch-4.3-mutex/SharedHash.c 2011-03-28 14:06:00.950400565 +0200 +@@ -95,6 +95,8 @@ + const char shScanFormat[] = SH_SCAN_FORMAT; + const char shPrintFormat[] = SH_PRINT_FORMAT; + ++int shMutexMech = APR_LOCK_DEFAULT; ++ + #ifdef BOUNDARY_CHECKING + char * + shVerifyString(struct shTable *tp, char *str) +@@ -509,7 +515,7 @@ + + rc = apr_global_mutex_create( + (apr_global_mutex_t **) &tp->mutex, +- tp->lockfile, APR_LOCK_DEFAULT, p ++ tp->lockfile, shMutexMech, p + ); + if (rc != APR_SUCCESS) { + ap_log_error( +diff -ur mod_watch-4.3/SharedHash.h mod_watch-4.3-mutex/SharedHash.h +--- mod_watch-4.3/SharedHash.h 2003-03-14 10:12:48.000000000 +0100 ++++ mod_watch-4.3-mutex/SharedHash.h 2011-03-28 14:04:55.726981348 +0200 +@@ -110,6 +110,8 @@ + extern "C" { + #endif + ++extern int shMutexMech; ++ + extern const char shLockFile[]; + extern const char shScanFormat[]; + extern const char shPrintFormat[]; ================================================================ ---- CVS-web: http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/apache-mod_watch/apache-mod_watch.conf?r1=1.4&r2=1.5&f=u http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/apache-mod_watch/apache-mod_watch.spec?r1=1.36&r2=1.37&f=u _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
