On Thu, May 16, 2013 at 9:06 AM, Thomas Thrainer <[email protected]>wrote:

> I changed the way to check for the master IP on the master node to fping
> -S 127.0.0.1, and if the master IP is not configured, now there's a check
> which looks for the master IP on another node. If it is configured on a
> different node, an error is produced.
>
> Interdiff:
>
> diff --git a/tools/master-ip-setup b/tools/master-ip-setup
> index d40b4c3..463def6 100755
> --- a/tools/master-ip-setup
> +++ b/tools/master-ip-setup
> @@ -62,10 +62,17 @@ start() {
>
>  # Stop the master IP
>  stop() {
> -  if ! ip addr show dev $MASTER_NETDEV | \
> -        grep -F " $MASTER_IP/$MASTER_NETMASK"  >/dev/null 2>&1; then
> -    echo "Master IP address not configured on this machine. Doing
> nothing."
> -    exit 0
> +  # Check if the master IP address is still configured on this machine
> +  if ! fping -S 127.0.0.1 $MASTER_IP >/dev/null 2>&1; then
> +    # Check if the master IP address is configured on another machine
> +    if fping $MASTER_IP >/dev/null 2>&1; then
> +      echo "Error: master IP address configured on another machine," \
> +           "can't shut it down." >&2
> +      exit 1
>

I'm not sure we should do the second fping. If the master ip is indeed not
active on the local node, should we really check other nodes? I believe
this script, at this level, should just return "success".
LGTM on the rest.

Thanks,
Guido

Reply via email to