[SCM] CTDB repository - branch master updated -
6d21fd57bedffce2298ce7fe4c7d889c858ba7fa
Andrew Tridgell
tridge at samba.org
Fri Jul 4 06:58:41 GMT 2008
The branch, master has been updated
via 6d21fd57bedffce2298ce7fe4c7d889c858ba7fa (commit)
via 9acd577c97059e8924582ac52e9ce5785903f120 (commit)
from 4edc6d40cb63936146af99030b7819683238abfc (commit)
http://gitweb.samba.org/?p=tridge/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 6d21fd57bedffce2298ce7fe4c7d889c858ba7fa
Author: Andrew Tridgell <tridge at samba.org>
Date: Fri Jul 4 16:58:29 2008 +1000
CTDB_NO_MEMORY_VOID() needs to return on error
commit 9acd577c97059e8924582ac52e9ce5785903f120
Author: Andrew Tridgell <tridge at samba.org>
Date: Fri Jul 4 16:58:14 2008 +1000
added option to start ctdb under valgrind
Just add CTDB_VALGRIND=yes in /etc/sysconfig/ctdb, and look at the
logs in /var/log/ctdb_valgrind.*
-----------------------------------------------------------------------
Summary of changes:
config/ctdb.init | 14 +++++++++++++-
include/ctdb_private.h | 2 +-
2 files changed, 14 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/config/ctdb.init b/config/ctdb.init
index 88ecc77..760d6de 100755
--- a/config/ctdb.init
+++ b/config/ctdb.init
@@ -73,7 +73,9 @@ CTDB_OPTIONS="$CTDB_OPTIONS --reclock=$CTDB_RECOVERY_LOCK"
CTDB_OPTIONS="$CTDB_OPTIONS --no-lmaster"
}
-if [ -x /sbin/startproc ]; then
+if [ "$CTDB_VALGRIND" = "yes" ]; then
+ init_style="valgrind"
+else if [ -x /sbin/startproc ]; then
init_style="suse"
else if [ -x /sbin/start-stop-daemon ]; then
init_style="ubuntu"
@@ -81,6 +83,7 @@ else if [ -x /sbin/start-stop-daemon ]; then
init_style="redhat"
fi
fi
+fi
start() {
killall -q ctdbd
@@ -100,6 +103,10 @@ start() {
done
case $init_style in
+ valgrind)
+ valgrind -q --log-file=/var/log/ctdb_valgrind /usr/sbin/ctdbd --nosetsched $CTDB_OPTIONS
+ RETVAL=0
+ ;;
suse)
startproc /usr/sbin/ctdbd $CTDB_OPTIONS
rc_status -v
@@ -134,6 +141,11 @@ stop() {
ctdb shutdown
RETVAL=$?
count=0
+ if [ "$init_style" = "valgrind" ]; then
+ # very crude method
+ sleep 2
+ pkill -9 -f valgrind
+ fi
while killall -q -0 ctdbd; do
sleep 1
count=`expr $count + 1`
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index e5a7b80..137dbee 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -439,7 +439,7 @@ struct ctdb_db_context {
#define CTDB_NO_MEMORY_VOID(ctdb, p) do { if (!(p)) { \
DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
- }} while (0)
+ return; }} while (0)
#define CTDB_NO_MEMORY_NULL(ctdb, p) do { if (!(p)) { \
DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
--
CTDB repository
More information about the samba-cvs
mailing list