Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Dev: ocf-shellfuncs: use $HA_VARLIB as default destination for trace …

…files

$HA_VARRUN (/var/run) will be cleaned on most platforms after
reboot. The trace file could be needed for examination between
reboots.
  • Loading branch information...
commit f5d4449874dc9158ee3b958685e71ba24c67759d 1 parent e77a222
@dmuhamedagic dmuhamedagic authored
Showing with 27 additions and 4 deletions.
  1. +22 −0 heartbeat/README
  2. +5 −4 heartbeat/ocf-shellfuncs.in
View
22 heartbeat/README
@@ -20,3 +20,25 @@ ora-common.sh.
Of course, if the RA is implemented in another programming
language, use the appropriate extension.
+
+RA tracing
+
+RA tracing may be turned on by setting OCF_TRACE_RA. The trace
+output will be saved to OCF_TRACE_FILE, if set, or by default to
+
+ $HA_VARLIB/trace_ra/<type>/<id>.<action>.<timestamp>
+
+e.g. $HA_VARLIB/trace_ra/oracle/db.start.2012-11-27.08:37:08
+
+HA_VARLIB is typically set to /var/lib/heartbeat.
+
+OCF_TRACE_FILE can be set to a path or file descriptor:
+
+- FD (small integer [3-9]) in that case it is up to the callers
+ to capture output; the FD _must_ be open for writing
+
+- absolute path
+
+NB: FD 9 may be used for tracing with bash >= v4 in case
+OCF_TRACE_FILE is set to a path.
+
View
9 heartbeat/ocf-shellfuncs.in
@@ -679,15 +679,16 @@ ocf_stop_processes() {
# RA tracing may be turned on by setting OCF_TRACE_RA
# the trace output will be saved to OCF_TRACE_FILE, if set, or
# by default to
-# $HA_VARRUN/ra_trace/<type>/<id>.<action>.<timestamp>
-# e.g. $HA_VARRUN/ra_trace/oracle/db.start.2012-11-27.08:37:08
+# $HA_VARLIB/trace_ra/<type>/<id>.<action>.<timestamp>
+# e.g. $HA_VARLIB/trace_ra/oracle/db.start.2012-11-27.08:37:08
#
# OCF_TRACE_FILE:
# - FD (small integer [3-9]) in that case it is up to the callers
# to capture output; the FD _must_ be open for writing
# - absolute path
#
-# NB: FD 9 may be used for tracing with bash >= v4
+# NB: FD 9 may be used for tracing with bash >= v4 in case
+# OCF_TRACE_FILE is set to a path.
#
ocf_is_bash4() {
echo "$SHELL" | grep bash > /dev/null &&
@@ -725,7 +726,7 @@ ocf_default_trace_dest() {
if [ -n "$OCF_RESOURCE_TYPE" -a \
-n "$OCF_RESOURCE_INSTANCE" -a -n "$__OCF_ACTION" ]; then
local ts=`date +%F.%T`
- __OCF_TRC_DEST=$HA_VARRUN/trace_ra/${OCF_RESOURCE_TYPE}/${OCF_RESOURCE_INSTANCE}.${__OCF_ACTION}.$ts
+ __OCF_TRC_DEST=$HA_VARLIB/trace_ra/${OCF_RESOURCE_TYPE}/${OCF_RESOURCE_INSTANCE}.${__OCF_ACTION}.$ts
__OCF_TRC_MANAGE="1"
fi
}
Please sign in to comment.
Something went wrong with that request. Please try again.