scripts: drop_all_public_ips() now prints messages to stdout, not log
authorMartin Schwenke <martin@meltin.net>
Sun, 16 Jun 2013 10:24:10 +0000 (20:24 +1000)
committerMartin Schwenke <martin@meltin.net>
Thu, 20 Jun 2013 03:01:09 +0000 (13:01 +1000)
Change all callers to maintain current behaviour.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/ctdb-crash-cleanup.sh
config/ctdb.init
config/functions

index d26838e9c5e2d326693cc2cec2198c7e66ac1f62..78eaa9326549fb48413f3ad78a343a5d4039402a 100755 (executable)
@@ -22,7 +22,7 @@ loadconfig ctdb
 [ -f "$CTDB_PUBLIC_ADDRESSES" ] || \
     die "No public addresses file found. Can't clean up."
 
-drop_all_public_ips "ctdb-crash-cleanup.sh"
+drop_all_public_ips 2>&1 | script_log "ctdb-crash-cleanup.sh"
 
 if [ -n "$CTDB_NATGW_PUBLIC_IP" ] ; then
     drop_ip "$CTDB_NATGW_PUBLIC_IP" "ctdb-crash-cleanup.sh"
index 2ceb45ff19191a4bd6e598a4ba975176a0e78d10..631235725bac60b50324ffee1ae84e02ffe81a80 100755 (executable)
@@ -249,7 +249,7 @@ start() {
 
     # make sure we drop any ips that might still be held if previous
     # instance of ctdb got killed with -9 or similar
-    drop_all_public_ips "ctdb.init"
+    drop_all_public_ips 2>&1 | script_log "ctdb.init"
 
     if select_tdb_checker ; then
        check_persistent_databases || return $?
@@ -334,7 +334,7 @@ stop() {
        }
     done
     # make sure all ips are dropped, pfkill -9 might leave them hanging around
-    drop_all_public_ips
+    drop_all_public_ips >/dev/null 2>&1
 
     rm -f "$pidfile"
 
index 0a806cbe2806dc30f799a44d658e13b65a696740..d121fb9f58e26b1d06b2ea6ba876a30d8bd09a32 100755 (executable)
@@ -1001,26 +1001,20 @@ ip_maskbits_iface ()
 drop_ip ()
 {
     _addr="${1%/*}"  # Remove optional maskbits
-    _log_tag="$2"
 
     set -- $(ip_maskbits_iface $_addr)
     if [ -n "$1" ] ; then
        _maskbits="$1"
        _iface="$2"
-       if [ -n "$_log_tag" ] ; then
-           script_log "$_log_tag" \
-               "Removing public address $_addr/$_maskbits from device $_iface"
-       fi
+       echo "Removing public address $_addr/$_maskbits from device $_iface"
        ip addr del $_addr/$_maskbits dev $_iface >/dev/null 2>&1
     fi
 }
 
 drop_all_public_ips ()
 {
-    _log_tag="$1"
-
     while read _ip _x ; do
-       drop_ip "$_ip" "$_log_tag"
+       drop_ip "$_ip"
     done <"${CTDB_PUBLIC_ADDRESSES:-/dev/null}"
 }