]> git.pld-linux.org Git - packages/apache-mod_watch.git/commitdiff
- rel 8 auto/th/apache-mod_watch-4_03-8
authorJan Rękorajski <baggins@pld-linux.org>
Mon, 28 Mar 2011 12:20:03 +0000 (12:20 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- configurable shm mutex mech to solve interoperability problems with mod_ruid2

Changed files:
    apache-mod_watch-mutex.patch -> 1.1
    apache-mod_watch.conf -> 1.5
    apache-mod_watch.spec -> 1.37

apache-mod_watch-mutex.patch [new file with mode: 0644]
apache-mod_watch.conf
apache-mod_watch.spec

diff --git a/apache-mod_watch-mutex.patch b/apache-mod_watch-mutex.patch
new file mode 100644 (file)
index 0000000..47014ed
--- /dev/null
@@ -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[];
index d3c189b8fbce161270dc0e311cb543641a3e45b7..4cf0203258f22560135b54bb178b5fe10f551586 100644 (file)
@@ -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 f2411f1be2353acee5f5219017946be83370a4cb..601a2b6b021a7b9290e3ece5839783fbdc52f508 100644 (file)
@@ -7,7 +7,7 @@ Summary:        Apache module: Monitoring Interface for MRTG
 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
@@ -15,6 +15,7 @@ Source0:      http://www.snert.com/Software/download/mod_watch%(echo %{version} | tr
 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
@@ -47,6 +48,7 @@ wspiera mod_vhost_alias oraz mod_gzip.
 %setup -q -n mod_%{mod_name}-4.3
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__make} -f Makefile.dso build \
This page took 0.128538 seconds and 4 git commands to generate.