]> granicus.if.org Git - apache/commitdiff
mod_lbmethod_heartbeat, mod_heartmonitor: Respect DefaultRuntimeDir/
authorJeff Trawick <trawick@apache.org>
Mon, 23 Jul 2012 16:01:43 +0000 (16:01 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 23 Jul 2012 16:01:43 +0000 (16:01 +0000)
DEFAULT_REL_RUNTIMEDIR for the heartbeat storage file.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1364695 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
include/heartbeat.h
modules/cluster/mod_heartmonitor.c
modules/proxy/balancers/mod_lbmethod_heartbeat.c

diff --git a/CHANGES b/CHANGES
index aeff44183ab94147f4118419339ec78c85d6422a..323ca3123f3751843573bc821469773749cef5bb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_lbmethod_heartbeat, mod_heartmonitor: Respect DefaultRuntimeDir/
+     DEFAULT_REL_RUNTIMEDIR for the heartbeat storage file.  [Jeff Trawick]
+
   *) mpm_event, mpm_worker: Remain active amidst prevalent child process
      resource shortages.  [Jeff Trawick]
 
index 7f9ed385216654b61d1d19906d017627e7825f5d..394aed8cc7fcfc4ba1ae958312bceb9df97b2f23 100644 (file)
@@ -47,6 +47,11 @@ 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 527bc38e110d1fef78cb689d2f42b13d374caf24..8e4231dc37e2f3c0e3113eea4b777c0d0623ab63 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_server_root_relative(p, "logs/hb.dat");
+    ctx->storage_path = ap_runtime_dir_relative(p, DEFAULT_HEARTBEAT_STORAGE);
     /* 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_server_root_relative(p, path);
+    ctx->storage_path = ap_runtime_dir_relative(p, path);
 
     return NULL;
 }
index 26c8158468a687cc6db97b7eb2ce69e68dfb2298..77fb994ff1a8de93cb68f854c13f7fd551b05da2 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_server_root_relative(p, "logs/hb.dat");
+    ctx->path = ap_runtime_dir_relative(p, DEFAULT_HEARTBEAT_STORAGE);
 
     return ctx;
 }
@@ -442,7 +442,7 @@ static const char *cmd_lb_hb_storage(cmd_parms *cmd,
         return err;
     }
 
-    ctx->path = ap_server_root_relative(p, path);
+    ctx->path = ap_runtime_dir_relative(p, path);
 
     return NULL;
 }