]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: LVS eventscript error redirection improvements
authorMartin Schwenke <martin@meltin.net>
Thu, 7 Apr 2016 03:55:08 +0000 (13:55 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 15 Apr 2016 03:57:17 +0000 (05:57 +0200)
Basic error redirection improvements before writing tests.

Deleting the service during "startup" will usually fail because the
service has never been setup, so redirect output to avoid logging an
error.

Similarly, deleting the service in "ipreallocated" will always fail
the first time, which would cause an error to be logged.  Given the
simplicity of the script, there's no sane way to avoid the error
sometimes and log it if it actually matters.  This could potentially
be tidied up in the future by making 91.lvs stateful, in a similar way
to 11.natgw.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/events.d/91.lvs

index 0e89bdc8b08b0a221cec44dba1eeffabeb6ced41..67c48be08b65f47c9e7d277eb6fe2ebc36168ae1 100755 (executable)
@@ -18,10 +18,10 @@ fi
 
 case "$1" in 
      startup)
-       ipvsadm -D -t $CTDB_LVS_PUBLIC_IP:0
-       ipvsadm -D -u $CTDB_LVS_PUBLIC_IP:0
+       ipvsadm -D -t $CTDB_LVS_PUBLIC_IP:0 >/dev/null 2>&1
+       ipvsadm -D -u $CTDB_LVS_PUBLIC_IP:0 >/dev/null 2>&1
 
-       ip addr add $CTDB_LVS_PUBLIC_IP/32 dev lo scope host >/dev/null 2>/dev/null
+       ip addr add $CTDB_LVS_PUBLIC_IP/32 dev lo scope host
 
        # do not respond to ARPs that are for ip addresses with scope 'host'
        set_proc_maybe sys/net/ipv4/conf/all/arp_ignore 3
@@ -41,8 +41,8 @@ case "$1" in
 
      recovered|ipreallocated)
        # kill off any tcp connections
-       ipvsadm -D -t $CTDB_LVS_PUBLIC_IP:0
-       ipvsadm -D -u $CTDB_LVS_PUBLIC_IP:0
+       ipvsadm -D -t $CTDB_LVS_PUBLIC_IP:0 >/dev/null 2>&1
+       ipvsadm -D -u $CTDB_LVS_PUBLIC_IP:0 >/dev/null 2>&1
        kill_tcp_connections_local_only \
                "$CTDB_PUBLIC_INTERFACE" "$CTDB_LVS_PUBLIC_IP"