diff options
author | Martin Schwenke <martin@meltin.net> | 2013-11-04 12:56:39 +1100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-11-27 18:46:16 +0100 |
commit | 4ab58a12a1895bb3be78e00045ff03ba65894ea5 (patch) | |
tree | 371ccdd68a25f7726e40daf75e1ea45f91bd4de5 | |
parent | 6fbf399191cddbf87181f4cf837f352df5dbfa76 (diff) | |
download | samba-4ab58a12a1895bb3be78e00045ff03ba65894ea5.tar.gz samba-4ab58a12a1895bb3be78e00045ff03ba65894ea5.tar.xz samba-4ab58a12a1895bb3be78e00045ff03ba65894ea5.zip |
ctdb-scripts: debug_locks.sh should use configuration to find TDB location
That is, don't use fixed paths.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
-rwxr-xr-x[-rw-r--r--] | ctdb/config/debug_locks.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ctdb/config/debug_locks.sh b/ctdb/config/debug_locks.sh index 0dde8615245..ce80835bba1 100644..100755 --- a/ctdb/config/debug_locks.sh +++ b/ctdb/config/debug_locks.sh @@ -7,9 +7,17 @@ # This script can be used only if Samba is configured to use fcntl locks # rather than mutex locks. +[ -n "$CTDB_BASE" ] || \ + export CTDB_BASE=$(cd -P $(dirname "$0") ; echo "$PWD") + +. "$CTDB_BASE/functions" + +loadconfig ctdb + # Create sed expression to convert inodes to names -sed_cmd=$( ls -li /var/ctdb/*.tdb.* /var/ctdb/persistent/*.tdb.* | - sed -e "s#/var/ctdb[/persistent]*/\(.*\)#\1#" | +sed_cmd=$( ls -li "$CTDB_DBDIR"/*.tdb.* "$CTDB_DBDIR_PERSISTENT"/*.tdb.* | + sed -e "s#${CTDB_DBDIR}/\(.*\)#\1#" \ + -e "s#${CTDB_DBDIR_PERSISTENT}/\(.*\)#\1#" | awk '{printf "s#[0-9]*:[0-9]*:%s #%s #\n", $1, $10}' ) # Parse /proc/locks and extract following information |