ctdb-scripts: Superficial clean-ups to 10.interface
[obnox/samba/samba-obnox.git] / ctdb / config / events.d / 10.interface
index 0cd11123f1dff889a061499e2177ce650dffb832..4b9f31c5a2b5d0b23b829b3fd8482c3c1cc1b11d 100755 (executable)
@@ -194,10 +194,8 @@ get_iface_ip_maskbits_family ()
 
 ctdb_check_args "$@"
 
-case "$1" in 
-     #############################
-     # called when ctdbd starts up
-     init)
+case "$1" in
+    init)
        # make sure that we only respond to ARP messages from the NIC where
        # a particular ip address is associated.
        get_proc sys/net/ipv4/conf/all/arp_filter >/dev/null 2>&1 && {
@@ -213,17 +211,11 @@ case "$1" in
        drop_all_public_ips
        ;;
 
-     #############################
-     # called after ctdbd has done its initial recovery
-     # and we start the services to become healthy
-     startup)
+    startup)
        monitor_interfaces
        ;;
 
-
-     ################################################
-     # called when ctdbd wants to claim an IP address
-     takeip)
+    takeip)
        iface=$2
        ip=$3
        maskbits=$4
@@ -242,10 +234,7 @@ case "$1" in
        flush_route_cache
        ;;
 
-
-     ##################################################
-     # called when ctdbd wants to release an IP address
-     releaseip)
+    releaseip)
        # releasing an IP is a bit more complex than it seems. Once the IP
        # is released, any open tcp connections to that IP on this host will end
        # up being stuck. Some of them (such as NFS connections) will be unkillable
@@ -275,9 +264,7 @@ case "$1" in
        flush_route_cache
        ;;
 
-     ##################################################
-     # called when ctdbd wants to update an IP address
-     updateip)
+    updateip)
        # moving an IP is a bit more complex than it seems.
        # First we drop all traffic on the old interface.
        # Then we try to add the ip to the new interface and before
@@ -320,12 +307,10 @@ case "$1" in
 
        # tickle all existing connections, so that dropped packets
        # are retransmited and the tcp streams work
-
        tickle_tcp_connections $ip
-
        ;;
 
-     monitor)
+    monitor)
        monitor_interfaces || exit 1
        ;;
     *)
@@ -334,4 +319,3 @@ case "$1" in
 esac
 
 exit 0
-