From: Jeff Trawick Date: Tue, 7 Aug 2012 14:49:44 +0000 (+0000) Subject: Mutex directive: finish support of DefaultRuntimeDir X-Git-Tag: 2.5.0-alpha~6473 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bf3d516f6a437f8b50d3c4e329a56894666cb93;p=thirdparty%2Fapache%2Fhttpd.git Mutex directive: finish support of DefaultRuntimeDir a partial conversion was made in r1299718, but I'm not sure when that change is effective git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1370288 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 887dfd33871..257af74c20e 100644 --- a/CHANGES +++ b/CHANGES @@ -25,7 +25,8 @@ Changes with Apache 2.5.0 *) The following now respect DefaultRuntimeDir/DEFAULT_REL_RUNTIMEDIR: - APIs: ap_log_pid(), ap_remove_pid, ap_read_pid() - - core: the scoreboard (ScoreBoardFile) and pid file (PidFile) + - core: the scoreboard (ScoreBoardFile), pid file (PidFile), and + mutexes (Mutex) - mod_lbmethod_heartbeat, mod_heartmonitor: heartbeat storage file - mod_socache_shmcb, mod_socache_dbm: shared memory or dbm for cache [Jeff Trawick] diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index e15b49e2fd1..fff90062011 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -3142,9 +3142,11 @@ or specified mutexes

With the file-based mechanisms fcntl and flock, the path, if provided, is a directory where the lock file will be created. - The default directory is httpd's run-time file directory relative to - ServerRoot. Always use a local disk - filesystem for /path/to/mutex and never a directory residing + The default directory is httpd's run-time file directory, + DefaultRuntimeDir. If a relative + path is provided, it is relative to + DefaultRuntimeDir. Always use a local + disk filesystem for /path/to/mutex and never a directory residing on a NFS- or AFS-filesystem. The basename of the file will be the mutex type, an optional instance string provided by the module, and unless the OmitPID keyword is specified, the process id of the httpd diff --git a/server/util_mutex.c b/server/util_mutex.c index e49cca5570e..72bb8f6e061 100644 --- a/server/util_mutex.c +++ b/server/util_mutex.c @@ -117,7 +117,7 @@ AP_DECLARE(apr_status_t) ap_parse_mutex(const char *arg, apr_pool_t *pool, * are looking to use */ if (file) { - *mutexfile = ap_server_root_relative(pool, file); + *mutexfile = ap_runtime_dir_relative(pool, file); if (!*mutexfile) { return APR_BADARG; } @@ -304,7 +304,7 @@ static const char *get_mutex_filename(apr_pool_t *p, mutex_cfg_t *mxcfg, } #endif - return ap_server_root_relative(p, + return ap_runtime_dir_relative(p, apr_pstrcat(p, mxcfg->dir, "/", @@ -552,7 +552,7 @@ AP_CORE_DECLARE(void) ap_dump_mutexes(apr_pool_t *p, server_rec *s, apr_file_t * } if (mxcfg->dir) - dir = ap_server_root_relative(p, mxcfg->dir); + dir = ap_runtime_dir_relative(p, mxcfg->dir); apr_file_printf(out, "Mutex %s: dir=\"%s\" mechanism=%s %s\n", name, dir, mech, mxcfg->omit_pid ? "[OmitPid]" : "");