]> granicus.if.org Git - apache/commitdiff
Revert r1373105, the merging of incompatible DefaultRuntimeDir
authorJeff Trawick <trawick@apache.org>
Tue, 14 Aug 2012 23:59:24 +0000 (23:59 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 14 Aug 2012 23:59:24 +0000 (23:59 +0000)
changes.

The trunk patches for these all have some configuration breakage
as 2.4.x interprets the individual directive or API parameter as
relative to ServerRoot whereas trunk interprets everything
relative to DefaultRuntimeDir.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1373168 13f79535-47bb-0310-9956-ffa450edef68

24 files changed:
CHANGES
STATUS
docs/conf/extra/httpd-mpm.conf.in
docs/conf/extra/httpd-ssl.conf.in
docs/manual/mod/core.xml
docs/manual/mod/mod_ldap.xml
docs/manual/mod/mod_socache_dbm.xml
docs/manual/mod/mod_socache_shmcb.xml
docs/manual/mod/mpm_common.xml
include/ap_config.h
include/heartbeat.h
include/http_log.h
include/scoreboard.h
modules/cache/mod_socache_dbm.c
modules/cache/mod_socache_shmcb.c
modules/cluster/mod_heartmonitor.c
modules/ldap/util_ldap.c
modules/proxy/balancers/mod_lbmethod_heartbeat.c
modules/slotmem/mod_slotmem_plain.c
server/core.c
server/log.c
server/mpm_common.c
server/scoreboard.c
server/util_mutex.c

diff --git a/CHANGES b/CHANGES
index 3e1921905e0019a196bd18207d2716448f4e7038..3f0893199a26bd07ab660487fdeded4c14b4bfbe 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -16,14 +16,8 @@ Changes with Apache 2.4.3
   *) ab: Fix read failure when targeting SSL server.  [Jeff Trawick]
 
   *) The following now respect DefaultRuntimeDir/DEFAULT_REL_RUNTIMEDIR:
-     - core: the scoreboard (ScoreBoardFile), pid file (PidFile), and
-       mutexes (Mutex)
      - mod_auth_digest: shared memory file
-     - APIs: ap_log_pid(), ap_remove_pid, ap_read_pid()
-     - mod_lbmethod_heartbeat, mod_heartmonitor: heartbeat storage file
-     - mod_ldap: shared memory cache
-     - mod_socache_shmcb, mod_socache_dbm: shared memory or dbm for cache
-     [Jeff Trawick, Jim Jagielski]
+     [Jeff Trawick]
 
   *) htpasswd: Use correct file mode for checking if file is writable.
      PR 45923. [Stefan Fritsch]
@@ -84,6 +78,11 @@ Changes with Apache 2.4.3
 
   *) Add "strict" and "warnings" pragmas to Perl scripts.  [Rich Bowen]
 
+  *) The following now respect DefaultRuntimeDir/DEFAULT_REL_RUNTIMEDIR:
+     - core: the scoreboard (ScoreBoardFile), pid file (PidFile), and
+       mutexes (Mutex)
+     [Jim Jagielski]
+
   *) ab: Fix bind() errors.  [Joe Orton]
 
   *) mpm_event: Don't do a blocking write when starting a lingering close
diff --git a/STATUS b/STATUS
index 5a47375e45d95f1baa328fa910635511c349eebd..cf1e0da4f10d471cbf511214df5e4a871599e937 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -89,6 +89,27 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
 
+   * opinion on more complete DefaultRuntimeDir use in 2.4.x?
+     o If a module has a config directive for the run-time file that
+       treats the configured path as relative to server root, preserve
+       that behavior but change the location when not configured to
+       respect DefaultRuntimeDir.  With these changes, users with no 
+       per-runtime-file configuration directives can control
+       everything with DefaultRuntimeDir.
+       BUT: Existing users of DefaultRuntimeDir might get a short-term scare
+       when some unconfigured run-time file starts respecting their 
+       DefaultRuntimeDir directive after an upgrade.
+       +1: trawick, jim, rjung
+       rjung: backport candidates are:
+          heartbeat          r1364695
+          scoreboard         r1369477
+          core/pid file      r1369808
+          core/mutex         r1370288
+          mod_socache_XXX    r1370225
+          mod_slotmem_plain  r1370763
+          mod_ldap           r1371684
+
+
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
index 0506d2fc91a2aff4cb1013529a90a5c4bba789b9..bf29fafe003912f0db1f3921136cf8884a830349 100644 (file)
@@ -9,7 +9,7 @@
 # Note that this is the default PidFile for most MPMs.
 #
 <IfModule !mpm_netware_module>
-    PidFile "httpd.pid"
+    PidFile "@rel_runtimedir@/httpd.pid"
 </IfModule>
 
 #
index 33db96d2fe127dfa9a33e07476754643229cdc9d..673d1aa8167ca210118646ffddd1d0696035f900 100644 (file)
@@ -72,8 +72,8 @@ SSLPassPhraseDialog  builtin
 #   Inter-Process Session Cache:
 #   Configure the SSL Session Cache: First the mechanism 
 #   to use and second the expiring timeout (in seconds).
-#SSLSessionCache         "dbm:ssl_scache"
-SSLSessionCache        "shmcb:ssl_scache(512000)"
+#SSLSessionCache         "dbm:@exp_runtimedir@/ssl_scache"
+SSLSessionCache        "shmcb:@exp_runtimedir@/ssl_scache(512000)"
 SSLSessionCacheTimeout  300
 
 ##
index e4dd46763f3b9ef75638525e8dd2fa4cdd22c23f..5d69de17426c25707719a4e8fd812dbc617462b0 100644 (file)
@@ -3142,11 +3142,9 @@ or specified mutexes</description>
 
     <p>With the file-based mechanisms <em>fcntl</em> and <em>flock</em>,
     the path, if provided, is a directory where the lock file will be created.
-    The default directory is httpd's run-time file directory,
-    <directive module="core">DefaultRuntimeDir</directive>.  If a relative
-    path is provided, it is relative to
-    <directive module="core">DefaultRuntimeDir</directive>.  Always use a local
-    disk filesystem for <code>/path/to/mutex</code> and never a directory residing
+    The default directory is httpd's run-time file directory relative to
+    <directive module="core">ServerRoot</directive>.  Always use a local disk
+    filesystem for <code>/path/to/mutex</code> 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
     <code>OmitPID</code> keyword is specified, the process id of the httpd
index 6afb1779bee23785858a1817691c7edd0ca5f2bc..bce703e884a5d85bc8aedf9ddf3f57b050c9638c 100644 (file)
@@ -418,16 +418,13 @@ LDAPTrustedGlobalCert CA_BASE64 /certs/cacert2.pem
 <directivesynopsis>
 <name>LDAPSharedCacheFile</name>
 <description>Sets the shared memory cache file</description>
-<syntax>LDAPSharedCacheFile <var>file-path</var></syntax>
+<syntax>LDAPSharedCacheFile <var>directory-path/filename</var></syntax>
 <contextlist><context>server config</context></contextlist>
 
 <usage>
-    <p>Specifies the path of the shared memory cache file. If not set, 
-    anonymous shared memory will be used if the platform supports it.</p>
-
-    <p>If <var>file-path</var> is not an absolute path, the location specified
-    will be relative to the value of 
-    <directive module="core">DefaultRuntimeDir</directive>.</p>
+    <p>Specifies the directory path and file name of the shared memory
+    cache file. If not set, anonymous shared memory will be used if the
+    platform supports it.</p>
 </usage>
 </directivesynopsis>
 
index bd627f08ebbbd78353042cccc39f8b1c3f5c1963..9cb636c92dcfde89f46151c96a3fc7d5f58ed697 100644 (file)
@@ -38,9 +38,6 @@
     dbm:/path/to/datafile
     </example>
 
-    <p>If the path is not absolute then it is assumed to be relative to
-    the <directive module="core">DefaultRuntimeDir</directive>.</p>
-
     <p>Details of other shared object cache providers can be found
     <a href="../socache.html">here</a>.
     </p>
index 7ee9c96042b07b237fb3603739791119caf3959e..9c6e61dad0c51ddd22ee74c9d877f621f7880c1d 100644 (file)
@@ -38,9 +38,6 @@
     shmcb:/path/to/datafile(512000)
     </example>
 
-    <p>If the path is not absolute then it is assumed to be relative to
-    the <directive module="core">DefaultRuntimeDir</directive>.</p>
-
     <p>Details of other shared object cache providers can be found
     <a href="../socache.html">here</a>.
     </p>
index 8ee82374590645334097dd87be0455dc1b5443d1..853003c2579e40aeffd77c30aee7e2dc139ef176 100644 (file)
@@ -130,7 +130,7 @@ will exit.</description>
 <description>File where the server records the process ID
 of the daemon</description>
 <syntax>PidFile <var>filename</var></syntax>
-<default>PidFile httpd.pid</default>
+<default>PidFile logs/httpd.pid</default>
 <contextlist><context>server config</context></contextlist>
 <modulelist><module>event</module><module>mpm_winnt</module>
 <module>mpmt_os2</module><module>prefork</module><module>worker</module>
@@ -140,7 +140,7 @@ of the daemon</description>
     <p>The <directive>PidFile</directive> directive sets the file to
     which the server records the process id of the daemon. If the
     filename is not absolute then it is assumed to be relative to the
-    <directive module="core">DefaultRuntimeDir</directive>.</p>
+    <directive module="core">ServerRoot</directive>.</p>
 
     <example><title>Example</title>
     <highlight language="config">
@@ -456,7 +456,7 @@ spikes</description>
 <description>Location of the file used to store coordination data for
 the child processes</description>
 <syntax>ScoreBoardFile <var>file-path</var></syntax>
-<default>ScoreBoardFile apache_runtime_status</default>
+<default>ScoreBoardFile logs/apache_runtime_status</default>
 <contextlist><context>server config</context></contextlist>
 <modulelist><module>event</module><module>mpm_winnt</module>
 <module>prefork</module><module>worker</module></modulelist>
@@ -470,10 +470,6 @@ the child processes</description>
     disk (using file-based shared memory). Specifying this directive causes
     Apache httpd to always create the file on the disk.</p>
 
-    <p>If <var>file-path</var> is not an absolute path, the location specified
-    will be relative to the value of 
-    <directive module="core">DefaultRuntimeDir</directive>.</p>
-
     <example><title>Example</title>
     <highlight language="config">
       ScoreBoardFile /var/run/apache_runtime_status
index b8ceedc78cdfa2db89455c1f6159a9ec40713d06..944b16afe9a1a3e4ddc597649a0734ffdb161cbe 100644 (file)
 
 /* Where the main/parent process's pid is logged */
 #ifndef DEFAULT_PIDLOG
-#define DEFAULT_PIDLOG "httpd.pid"
+#define DEFAULT_PIDLOG DEFAULT_REL_RUNTIMEDIR "/httpd.pid"
 #endif
 
 #if defined(NETWARE)
index 394aed8cc7fcfc4ba1ae958312bceb9df97b2f23..7f9ed385216654b61d1d19906d017627e7825f5d 100644 (file)
@@ -47,11 +47,6 @@ typedef struct hm_slot_server_t
     int id;
 } hm_slot_server_t;
 
-/* default name of heartbeat data file, created in the configured
- * runtime directory when mod_slotmem_shm is not available
- */
-#define DEFAULT_HEARTBEAT_STORAGE "hb.dat"
-
 #ifdef __cplusplus
 }
 #endif
index 7fc31a6f077a7c43f55642c71680c0e1ecc4bcd1..acad032817dd13bd5630544cfa1cb9b4d536e66c 100644 (file)
@@ -570,7 +570,7 @@ AP_DECLARE(void) ap_log_command_line(apr_pool_t *p, server_rec *s);
  * Log the current pid of the parent process
  * @param p The pool to use for processing
  * @param fname The name of the file to log to.  If the filename is not
- * absolute then it is assumed to be relative to DefaultRuntimeDir.
+ * absolute then it is assumed to be relative to ServerRoot.
  */
 AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *fname);
 
@@ -578,15 +578,15 @@ AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *fname);
  * Remove the pidfile.
  * @param p The pool to use for processing
  * @param fname The name of the pid file to remove.  If the filename is not
- * absolute then it is assumed to be relative to DefaultRuntimeDir.
+ * absolute then it is assumed to be relative to ServerRoot.
  */
 AP_DECLARE(void) ap_remove_pid(apr_pool_t *p, const char *fname);
 
 /**
  * Retrieve the pid from a pidfile.
  * @param p The pool to use for processing
- * @param filename The name of the file containing the pid.  If the filename
- * is not absolute then it is assumed to be relative to DefaultRuntimeDir.
+ * @param filename The name of the file containing the pid.  If the filename is not
+ * absolute then it is assumed to be relative to ServerRoot.
  * @param mypid Pointer to pid_t (valid only if return APR_SUCCESS)
  */
 AP_DECLARE(apr_status_t) ap_read_pid(apr_pool_t *p, const char *filename, pid_t *mypid);
index 393cbe9f2999c560c7afc8cd29f4e38bde6ba896..2fd2960e4995073fa2be1aa5db9ec67faa1cf977 100644 (file)
@@ -40,7 +40,7 @@ extern "C" {
 
 /* Scoreboard file, if there is one */
 #ifndef DEFAULT_SCOREBOARD
-#define DEFAULT_SCOREBOARD "apache_runtime_status" /* within DEFAULT_REL_RUNTIMEDIR */
+#define DEFAULT_SCOREBOARD "logs/apache_runtime_status"
 #endif
 
 /* Scoreboard info on a process is, for now, kept very brief ---
index 984d2b7111c312a23e721651670ac51e0785669c..0d7c302bafa031456cde978545ef0bb64a360cb8 100644 (file)
@@ -84,7 +84,7 @@ static const char *socache_dbm_create(ap_socache_instance_t **context,
     *context = ctx = apr_pcalloc(p, sizeof *ctx);
 
     if (arg && *arg) {
-        ctx->data_file = ap_runtime_dir_relative(p, arg);
+        ctx->data_file = ap_server_root_relative(p, arg);
         if (!ctx->data_file) {
             return apr_psprintf(tmp, "Invalid cache file path %s", arg);
         }
index e86e7de57657a9afbb7faaf71f713d8c08b8693e..4c892d07ce60e5118ca408cfcb06d460bd161986 100644 (file)
@@ -285,7 +285,7 @@ static const char *socache_shmcb_create(ap_socache_instance_t **context,
         return NULL;
     }
 
-    ctx->data_file = path = ap_runtime_dir_relative(p, arg);
+    ctx->data_file = path = ap_server_root_relative(p, arg);
 
     cp = strrchr(path, '(');
     cp2 = path + strlen(path) - 1;
index 8e4231dc37e2f3c0e3113eea4b777c0d0623ab63..527bc38e110d1fef78cb689d2f42b13d374caf24 100644 (file)
@@ -792,7 +792,7 @@ static void *hm_create_config(apr_pool_t *p, server_rec *s)
     hm_ctx_t *ctx = (hm_ctx_t *) apr_palloc(p, sizeof(hm_ctx_t));
 
     ctx->active = 0;
-    ctx->storage_path = ap_runtime_dir_relative(p, DEFAULT_HEARTBEAT_STORAGE);
+    ctx->storage_path = ap_server_root_relative(p, "logs/hb.dat");
     /* TODO: Add directive for tuning the update interval
      */
     ctx->interval = apr_time_from_sec(HM_UPDATE_SEC);
@@ -816,7 +816,7 @@ static const char *cmd_hm_storage(cmd_parms *cmd,
         return err;
     }
 
-    ctx->storage_path = ap_runtime_dir_relative(p, path);
+    ctx->storage_path = ap_server_root_relative(p, path);
 
     return NULL;
 }
index ad2c395948807ab833c1a5c88f7a224c98214716..c7f7b93df1f811254b4dd332766d0a55ea7a1c32 100644 (file)
@@ -2103,7 +2103,7 @@ static const char *util_ldap_set_cache_file(cmd_parms *cmd, void *dummy,
     }
 
     if (file) {
-        st->cache_file = ap_runtime_dir_relative(st->pool, file);
+        st->cache_file = ap_server_root_relative(st->pool, file);
     }
     else {
         st->cache_file = NULL;
index 77fb994ff1a8de93cb68f854c13f7fd551b05da2..26c8158468a687cc6db97b7eb2ce69e68dfb2298 100644 (file)
@@ -407,7 +407,7 @@ static void *lb_hb_create_config(apr_pool_t *p, server_rec *s)
 {
     lb_hb_ctx_t *ctx = (lb_hb_ctx_t *) apr_palloc(p, sizeof(lb_hb_ctx_t));
 
-    ctx->path = ap_runtime_dir_relative(p, DEFAULT_HEARTBEAT_STORAGE);
+    ctx->path = ap_server_root_relative(p, "logs/hb.dat");
 
     return ctx;
 }
@@ -442,7 +442,7 @@ static const char *cmd_lb_hb_storage(cmd_parms *cmd,
         return err;
     }
 
-    ctx->path = ap_runtime_dir_relative(p, path);
+    ctx->path = ap_server_root_relative(p, path);
 
     return NULL;
 }
index dc62f46f85b83d68d572672bf383152f5bb55efb..47da15b49a0b3ca2fcd3a4531c85b6d040ce0862 100644 (file)
@@ -75,7 +75,7 @@ static apr_status_t slotmem_create(ap_slotmem_instance_t **new, const char *name
         if (name[0] == ':')
             fname = name;
         else
-            fname = ap_runtime_dir_relative(pool, name);
+            fname = ap_server_root_relative(pool, name);
 
         /* first try to attach to existing slotmem */
         if (next) {
@@ -126,7 +126,7 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new, const char *name
         if (name[0] == ':')
             fname = name;
         else
-            fname = ap_runtime_dir_relative(pool, name);
+            fname = ap_server_root_relative(pool, name);
     }
     else
         return APR_ENOSHMAVAIL;
index 5d0e12d668352f97d07eb15443f0f84e8dd7e161..03137577de2a167fe73e81a61c0b38a983121c9c 100644 (file)
@@ -4799,7 +4799,7 @@ static void core_dump_config(apr_pool_t *p, server_rec *s)
         tmp = s->error_fname;
     apr_file_printf(out, "Main ErrorLog: \"%s\"\n", tmp);
     if (ap_scoreboard_fname) {
-        tmp = ap_runtime_dir_relative(p, ap_scoreboard_fname);
+        tmp = ap_server_root_relative(p, ap_scoreboard_fname);
         apr_file_printf(out, "ScoreBoardFile: \"%s\"\n", tmp);
     }
     ap_dump_mutexes(p, s, out);
index 1c9a59bb1e78db2ab3537ee59fcce332cc212355..b33aa1fc1b98b296763ae366998fe5ce1b3e6ea5 100644 (file)
@@ -1394,7 +1394,7 @@ AP_DECLARE(void) ap_log_command_line(apr_pool_t *plog, server_rec *s)
 AP_DECLARE(void) ap_remove_pid(apr_pool_t *p, const char *rel_fname)
 {
     apr_status_t rv;
-    const char *fname = ap_runtime_dir_relative(p, rel_fname);
+    const char *fname = ap_server_root_relative(p, rel_fname);
 
     if (fname != NULL) {
         rv = apr_file_remove(fname, p);
@@ -1423,7 +1423,7 @@ AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *filename)
         return;
     }
 
-    fname = ap_runtime_dir_relative(p, filename);
+    fname = ap_server_root_relative(p, filename);
     if (!fname) {
         ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, APR_EBADPATH,
                      NULL, APLOGNO(00097) "Invalid PID file path %s, ignoring.", filename);
@@ -1476,7 +1476,7 @@ AP_DECLARE(apr_status_t) ap_read_pid(apr_pool_t *p, const char *filename,
         return APR_EGENERAL;
     }
 
-    fname = ap_runtime_dir_relative(p, filename);
+    fname = ap_server_root_relative(p, filename);
     if (!fname) {
         ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, APR_EBADPATH,
                      NULL, APLOGNO(00101) "Invalid PID file path %s, ignoring.", filename);
index e33bd11c9eb88637b79ba3aca2f8edad59999ef5..4448ec60dcf14bebe42b3ed45096dd3ca4fad051 100644 (file)
@@ -307,7 +307,7 @@ const char *ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
 void ap_mpm_dump_pidfile(apr_pool_t *p, apr_file_t *out)
 {
     apr_file_printf(out, "PidFile: \"%s\"\n",
-                    ap_runtime_dir_relative(p, ap_pid_fname));
+                    ap_server_root_relative(p, ap_pid_fname));
 }
 
 const char *ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
index 67b0386c4b93143ade5f2d8e26139f34e1df9825..bef2b90908a98d250483b2437704560b6c583d2f 100644 (file)
@@ -217,7 +217,7 @@ static apr_status_t open_scoreboard(apr_pool_t *pconf)
     /* The config says to create a name-based shmem */
     if (ap_scoreboard_fname) {
         /* make sure it's an absolute pathname */
-        fname = ap_runtime_dir_relative(pconf, ap_scoreboard_fname);
+        fname = ap_server_root_relative(pconf, ap_scoreboard_fname);
         if (!fname) {
             ap_log_error(APLOG_MARK, APLOG_CRIT, APR_EBADPATH, ap_server_conf, APLOGNO(00003)
                          "Fatal error: Invalid Scoreboard path %s",
@@ -239,7 +239,7 @@ static apr_status_t open_scoreboard(apr_pool_t *pconf)
         else if (rv == APR_ENOTIMPL) {
             /* Make sure it's an absolute pathname */
             ap_scoreboard_fname = DEFAULT_SCOREBOARD;
-            fname = ap_runtime_dir_relative(pconf, ap_scoreboard_fname);
+            fname = ap_server_root_relative(pconf, ap_scoreboard_fname);
 
             return create_namebased_scoreboard(global_pool, fname);
         }
index 72bb8f6e0611cc306aef016f42fe62e847ad1847..e49cca5570e352cb49e2ddedddc522eafe87088a 100644 (file)
@@ -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_runtime_dir_relative(pool, file);
+        *mutexfile = ap_server_root_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_runtime_dir_relative(p,
+    return ap_server_root_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_runtime_dir_relative(p, mxcfg->dir);
+            dir = ap_server_root_relative(p, mxcfg->dir);
 
         apr_file_printf(out, "Mutex %s: dir=\"%s\" mechanism=%s %s\n", name, dir, mech,
                         mxcfg->omit_pid ? "[OmitPid]" : "");