diff options
author | Martin Schwenke <martin@meltin.net> | 2015-04-18 22:00:49 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2015-04-27 03:32:10 +0200 |
commit | 09b5e4978ab1df09f47156147848a6bf099ea665 (patch) | |
tree | c225dfc648946356dc7550cdba1fb39461db9b25 /ctdb/config/statd-callout | |
parent | af93ae1a540003824b32301d3c9f09c713f1fa7a (diff) | |
download | samba-09b5e4978ab1df09f47156147848a6bf099ea665.tar.gz |
ctdb-scripts: Changed uses of "ctdb xpnn" to ctdb_get_pnn()
"ctdb xpnn" does not work when sysctl net.ipv4.ip_nonlocal_bind=1,
since it determines the node by attempting to bind to each addres in
the nodes file. The solution is to not use "ctdb xpnn". After the
initial call, ctdb_get_pnn() will be more efficient that "ctdb xpnn".
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/config/statd-callout')
-rwxr-xr-x | ctdb/config/statd-callout | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ctdb/config/statd-callout b/ctdb/config/statd-callout index 4a331aca2cf..347af41a7cd 100755 --- a/ctdb/config/statd-callout +++ b/ctdb/config/statd-callout @@ -47,7 +47,7 @@ case "$1" in # statd does not tell us to which IP the client connected so # we must add it to all the IPs that we serve cip="$2" - pnn=$(ctdb xpnn | sed -e 's/.*://') + ctdb_get_pnn date=$(date '+%s') ctdb ip -X | tail -n +2 | @@ -62,7 +62,7 @@ case "$1" in # statd does not tell us from which IP the client disconnected # so we must add it to all the IPs that we serve cip="$2" - pnn=$(ctdb xpnn | sed -e 's/.*://') + ctdb_get_pnn ctdb ip -X | tail -n +2 | while IFS="|" read x sip node x ; do @@ -80,7 +80,7 @@ case "$1" in fi # Filter out lines for any IP addresses that are not currently # hosted public IP addresses. - pnn=$(ctdb xpnn | sed -e 's/.*://') + ctdb_get_pnn ctdb_ips=$(ctdb ip | tail -n +2) sed_expr=$(echo "$ctdb_ips" | awk -v pnn=$pnn 'pnn == $2 { \ @@ -156,7 +156,7 @@ case "$1" in # probability that the client will accept the statd notify packet and # not just ignore it. # For all IPs we serve, collect info and push to the config database - pnn=$(ctdb xpnn | sed -e 's/.*://') + ctdb_get_pnn # Construct a sed expression to take catdb output and produce pairs of: # server-IP client-IP |