[SCM] CTDB repository - branch 1.0.112 updated - ctdb-1.0.111-132-g1e712b6
Ronnie Sahlberg
sahlberg at samba.org
Sun Aug 8 22:01:30 MDT 2010
The branch, 1.0.112 has been updated
via 1e712b6f017af851cfcd0b8aa4ed0802cb01a5ea (commit)
via 9bfd66812d3f73ae1680777983181a9fb0f31207 (commit)
from ebed50dc9c231ab43552c52ee9ea928fa4eec068 (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=1.0.112
- Log -----------------------------------------------------------------
commit 1e712b6f017af851cfcd0b8aa4ed0802cb01a5ea
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Mon Aug 9 12:29:39 2010 +1000
disable the check that winbind works or not for now
commit 9bfd66812d3f73ae1680777983181a9fb0f31207
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Jul 26 16:22:59 2010 +1000
Optimise 61.nfstickle to write the tickles more efficiently.
Currently the file for each IP address is reopened to append the
details of each source socket.
This optimisation puts all the logic into awk, including the matching
of output lines from netstat. The source sockets for each for each
destination IP are written into an array entry and then each array
entry is written to the corresponding file in a single operation.
Signed-off-by: Martin Schwenke <martin at meltin.net>
-----------------------------------------------------------------------
Summary of changes:
config/events.d/50.samba | 10 +++++-----
config/events.d/61.nfstickle | 33 ++++++++++++++-------------------
2 files changed, 19 insertions(+), 24 deletions(-)
Changeset truncated at 500 lines:
diff --git a/config/events.d/50.samba b/config/events.d/50.samba
index 23dd060..e34066b 100755
--- a/config/events.d/50.samba
+++ b/config/events.d/50.samba
@@ -251,11 +251,11 @@ case "$1" in
ctdb_check_tcp_ports $smb_ports || exit $?
}
- # check winbind is OK
- check_ctdb_manages_winbind
- [ "$CTDB_MANAGES_WINBIND" = "yes" ] && {
- ctdb_check_command "winbind" "wbinfo -p"
- }
+# # check winbind is OK
+# check_ctdb_manages_winbind
+# [ "$CTDB_MANAGES_WINBIND" = "yes" ] && {
+# ctdb_check_command "winbind" "wbinfo -p"
+# }
;;
*)
diff --git a/config/events.d/61.nfstickle b/config/events.d/61.nfstickle
index 9900498..9802358 100755
--- a/config/events.d/61.nfstickle
+++ b/config/events.d/61.nfstickle
@@ -15,24 +15,6 @@ ctdb_start_stop_service
[ -z "$NFS_TICKLE_SHARED_DIRECTORY" ] && exit 0
-store_tickles()
-{
- # always create these direcotries since NFS might be enabled at runtime
- # and we dont want to restart ctdbd
- mkdir -p $CTDB_BASE/state/nfstickle
- mkdir -p $NFS_TICKLE_SHARED_DIRECTORY/`hostname`
-
- mydir=$NFS_TICKLE_SHARED_DIRECTORY/`hostname`
- rm -f $mydir/*
- # record our connections to shared storage
- netstat -tn |egrep '^tcp[[:space:]]+[0-9]+[[:space:]]+[0-9]+[[:space:]]+[0-9\.]+:2049.*ESTABLISHED' |
- awk '{print $4" "$5}' |
- while read dest src; do
- ip=${dest%:*}
- echo $src >> $mydir/$ip
- done
-}
-
case "$1" in
startup)
ctdb_service_start
@@ -57,7 +39,20 @@ case "$1" in
;;
monitor)
- store_tickles &
+ mydir=$NFS_TICKLE_SHARED_DIRECTORY/`hostname`
+ rm -f $mydir/*
+ # record our connections to shared storage
+ netstat -tn |
+ awk -v mydir="$mydir" '
+$1 == "tcp" && $6 == "ESTABLISHED" && $4 ~ /:2049$/ {
+ destip = gensub(/:2049$/, "", 1, $4);
+ c[destip] = c[destip] (c[destip] ? "\n" : "" ) $5;
+}
+END {
+ for (ip in c) {
+ print c[ip] > mydir "/" ip
+ }
+}'
;;
*)
--
CTDB repository
More information about the samba-cvs
mailing list