]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Event script indentation and whitespace cleanups
authorMartin Schwenke <martin@meltin.net>
Wed, 6 Jul 2016 04:44:14 +0000 (14:44 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 21 Jul 2016 00:24:25 +0000 (02:24 +0200)
* Re-indent case labels as per new script style

  Other indentation can be tweaked later as code changes, but the
  labels are an obvious bulk change.

* Minor whitespace fixes

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
16 files changed:
ctdb/config/events.d/00.ctdb
ctdb/config/events.d/01.reclock
ctdb/config/events.d/05.system
ctdb/config/events.d/10.interface
ctdb/config/events.d/11.natgw
ctdb/config/events.d/11.routing
ctdb/config/events.d/13.per_ip_routing
ctdb/config/events.d/20.multipathd
ctdb/config/events.d/31.clamd
ctdb/config/events.d/40.vsftpd
ctdb/config/events.d/41.httpd
ctdb/config/events.d/49.winbind
ctdb/config/events.d/50.samba
ctdb/config/events.d/60.nfs
ctdb/config/events.d/70.iscsi
ctdb/config/events.d/99.timeout

index c4d98a29cf7eaee41ce1a1aee86fe3e54b1c9eab..175a44de6e3b805509c3a1f3423331515269e904 100755 (executable)
@@ -121,7 +121,7 @@ set_ctdb_variables ()
 ctdb_check_args "$@"
 
 case "$1" in
-     init)
+init)
         # make sure we have a blank state directory for the scripts to work with
        rm -rf "$CTDB_SCRIPT_VARDIR"
        mkdir -p "$CTDB_SCRIPT_VARDIR" || \
@@ -133,13 +133,13 @@ case "$1" in
        fi
        ;;
 
-    setup)
+setup)
        # Set any tunables from the config file
        set_ctdb_variables || \
            die "Aborting setup due to invalid configuration - fix typos, remove unknown tunables"
        ;;
 
-    startup)
+startup)
        $CTDB attach ctdb.tdb persistent
        ;;
 esac
index 0377ca4c84753598dfa32189fda7e0b5d1a7aa42..45b2405ce94c78865f35f4b6bef74651e92b7dbe 100755 (executable)
@@ -15,7 +15,7 @@ case "$CTDB_RECOVERY_LOCK" in
 esac
 
 case "$1" in
-    init)
+init)
        ctdb_counter_init
 
        if [ -n "$CTDB_RECOVERY_LOCK" ] ; then
@@ -24,7 +24,7 @@ case "$1" in
        fi
        ;;
 
-    monitor)
+monitor)
        # Early exit if not using a reclock file
        [ -n "$CTDB_RECOVERY_LOCK" ] || exit 0
 
index 38e40276bf29ef964d8732d3ea8efad4b52ddb88..780b6b98a53ae07f69a1dd9c8af5104110a5d671 100755 (executable)
@@ -164,7 +164,7 @@ END {
 
 
 case "$1" in
-    monitor)
+monitor)
        monitor_filesystem_usage
        monitor_memory_usage
        ;;
index 57baba7c4ff02e594a6b2ac2bc1b0a91aae6aa16..c6938d12ed9579c6cfed0ec8f00ceccbab9511e7 100755 (executable)
@@ -138,7 +138,7 @@ ip_unblock ()
 ctdb_check_args "$@"
 
 case "$1" in
-    init)
+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 && {
@@ -154,11 +154,11 @@ case "$1" in
        drop_all_public_ips
        ;;
 
-    startup)
+startup)
        monitor_interfaces
        ;;
 
-    takeip)
+takeip)
        iface=$2
        ip=$3
        maskbits=$4
@@ -173,7 +173,7 @@ case "$1" in
        flush_route_cache
        ;;
 
-    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
@@ -201,7 +201,7 @@ case "$1" in
        flush_route_cache
        ;;
 
-    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
@@ -243,7 +243,7 @@ case "$1" in
        tickle_tcp_connections "$ip"
        ;;
 
-    monitor)
+monitor)
        monitor_interfaces || exit 1
        ;;
 esac
index 9fdf93f2887deef8f8851b9ae0d5b2de0a86af91..2cfe75b6acfe3232fb7b0cb7a9ebefda08e8deea 100755 (executable)
@@ -184,11 +184,11 @@ natgw_save_state ()
 
 
 case "$1" in
-    setup)
+setup)
        natgw_check_config
        ;;
 
-    startup)
+startup)
        natgw_check_config
 
        # Error if CTDB_NATGW_PUBLIC_IP is listed in public addresses
@@ -202,7 +202,7 @@ case "$1" in
        set_proc sys/net/ipv4/conf/all/arp_announce 2
        ;;
 
-    updatenatgw|ipreallocated)
+updatenatgw|ipreallocated)
        natgw_check_config
 
        ctdb_get_pnn
@@ -226,12 +226,12 @@ case "$1" in
        natgw_save_state
        ;;
 
-    shutdown|removenatgw)
+shutdown|removenatgw)
        natgw_check_config
        natgw_clear
        ;;
 
-    monitor)
+monitor)
        natgw_check_config
 
        if [ -n "$CTDB_NATGW_PUBLIC_IFACE" ] ; then
index 941a7a8f1311908747ff793893ea2ed97bcaed32..c8d875cd732cefe630954cdc2e85223d92fc3fd7 100755 (executable)
@@ -29,13 +29,13 @@ loadconfig
 }
 
 case "$1" in
-    ipreallocated)
+ipreallocated)
         while read iface dest gw; do
             ip route add "$dest" via "$gw" dev "$iface" >/dev/null 2>&1
         done <"${CTDB_BASE}/static-routes"
         ;;
 
-    updateip)
+updateip)
        oiface=$2
        niface=$3
        while read iface dest gw; do
index 34bbf7f332a3fb311b6877dc517c13276922c7be..bee8e2cc4809b23a3a472a5b066649517589ac57 100755 (executable)
@@ -357,7 +357,7 @@ ctdb_check_args "$@"
 ctdb_service_check_reconfigure
 
 case "$1" in
-    startup)
+startup)
        flush_rules_and_routes
 
        # make sure that we only respond to ARP messages from the NIC
@@ -367,12 +367,12 @@ case "$1" in
        }
        ;;
 
-    shutdown)
+shutdown)
        flush_rules_and_routes
        clean_up_table_ids
        ;;
 
-    takeip)
+takeip)
        iface=$2
        ip=$3
        maskbits=$4
@@ -386,7 +386,7 @@ case "$1" in
        $CTDB gratiousarp "$ip" "$iface"
        ;;
 
-    updateip)
+updateip)
        oiface=$2
        niface=$3
        ip=$4
@@ -402,7 +402,7 @@ case "$1" in
        tickle_tcp_connections "$ip"
        ;;
 
-    releaseip)
+releaseip)
        iface=$2
        ip=$3
        maskbits=$4
@@ -411,7 +411,7 @@ case "$1" in
        del_routing_for_ip "$ip"
        ;;
 
-    ipreallocated)
+ipreallocated)
        add_missing_routes
        remove_bogus_routes
        ;;
index c16c24cf33512298d66303e189922eac8b693819..92561589029f728368387a9438ae304f7cd85ec4 100755 (executable)
@@ -72,7 +72,7 @@ multipathd_check()
 }
 
 case "$1" in
-    monitor)
+monitor)
        multipathd_check || die "multipath monitoring failed"
        ;;
 esac
index 22b11b8f851628612b969156f27ac9325fc0d4e3..c2ee8de5369ed6af5e25d6d91807ba7df7be91cd 100755 (executable)
@@ -9,14 +9,14 @@
 detect_init_style
 
 case $CTDB_INIT_STYLE in
-       redhat)
-               service_name="clamd"
-               service_config="clamd"
-               ;;
-       *)
-               service_name="clamav"
-               service_config="clamav"
-               ;;
+redhat)
+       service_name="clamd"
+       service_config="clamd"
+       ;;
+*)
+       service_name="clamav"
+       service_config="clamav"
+       ;;
 esac
 
 service_start ()
@@ -31,16 +31,16 @@ ctdb_start_stop_service
 
 is_ctdb_managed_service || exit 0
 
-case "$1" in 
-    startup)
+case "$1" in
+startup)
        ctdb_service_start
         ;;
 
-    shutdown)
+shutdown)
         ctdb_service_stop
         ;;
 
-    monitor)
+monitor)
         ctdb_check_unix_socket ${CTDB_CLAMD_SOCKET} || exit $?
         ;;
 esac
index 5f2f44a79ad1b128de973a1ff980f62908124d0b..64da6fd16d2984112735e7431c543051910b9602 100755 (executable)
@@ -34,20 +34,20 @@ is_ctdb_managed_service || exit 0
 
 ctdb_service_check_reconfigure
 
-case "$1" in 
-    startup)
+case "$1" in
+startup)
        ctdb_service_start
        ;;
 
-    shutdown)
+shutdown)
        ctdb_service_stop
        ;;
 
-    takeip|releaseip)
+takeip|releaseip)
        ctdb_service_set_reconfigure
        ;;
 
-    monitor)
+monitor)
        if [ -n "$service_tcp_ports" ] ; then
            if ctdb_check_tcp_ports $service_tcp_ports ; then
                ctdb_counter_init
index 9fb75072254d16608c41838516eae1dc13d667be..7e3e3e3bccc8a4bd5638e3c071b6ed699c753cd2 100755 (executable)
@@ -9,11 +9,11 @@
 detect_init_style
 
 case $CTDB_INIT_STYLE in
-    redhat)
+redhat)
        service_name="httpd"
        service_config="http"
        ;;
-    suse|debian|*)
+suse|debian|*)
        service_name="apache2"
        service_config="apache2"
        ;;
@@ -48,15 +48,15 @@ ctdb_start_stop_service
 is_ctdb_managed_service || exit 0
 
 case "$1" in
-    startup)
+startup)
        ctdb_service_start
        ;;
 
-    shutdown)
+shutdown)
        ctdb_service_stop
        ;;
 
-    monitor)
+monitor)
        if ctdb_check_tcp_ports 80 >/dev/null 2>/dev/null ; then
            ctdb_counter_init
        else
index db93fafc160eb8f527941ee85d3ced45ea336a7b..495ac5791e3e3ec465fe41ed268be400fe40350d 100755 (executable)
@@ -40,16 +40,16 @@ is_ctdb_managed_service || exit 0
 
 ###########################
 
-case "$1" in 
-     startup)
+case "$1" in
+startup)
        ctdb_service_start
        ;;
-       
-     shutdown)
+
+shutdown)
        ctdb_service_stop
        ;;
 
-     monitor)
+monitor)
        ctdb_check_command wbinfo -p
        ;;
 esac
index ee4033f1c440274c614f7d4380827109952c0605..82b9b96029dc3d10afc7d4cfbd22f0f72c73e98c 100755 (executable)
@@ -153,15 +153,15 @@ is_ctdb_managed_service || exit 0
 ###########################
 
 case "$1" in
-     startup)
+startup)
        ctdb_service_start
        ;;
 
-     shutdown)
+shutdown)
        ctdb_service_stop
        ;;
 
-     monitor)
+monitor)
        testparm_foreground_update 10
        ret=$?
 
index e5d87424ce678bbb59f188b586bf94f5fcda3ea3..6b2bdbc57586b94c9a167b146f798656b3f33ce7 100755 (executable)
@@ -246,25 +246,25 @@ is_ctdb_managed_service || exit 0
 ctdb_service_check_reconfigure
 
 case "$1" in
-    startup)
+startup)
        nfs_callout "$@"
        ;;
 
-    shutdown)
+shutdown)
         nfs_callout "$@"
        ;;
 
-    takeip)
+takeip)
        nfs_callout "$@"
        ctdb_service_set_reconfigure
        ;;
 
-    releaseip)
+releaseip)
        nfs_callout "$@"
        ctdb_service_set_reconfigure
        ;;
 
-    monitor)
+monitor)
        nfs_callout "monitor-pre" || exit $?
 
        # Check that directories for shares actually exist
index 8c3f712b28df6c18d9eabd1d181b2ba6efc79101..83f69bf0001fce488261b441ba0ba25a14ab3b4b 100755 (executable)
@@ -21,7 +21,7 @@ is_ctdb_managed_service || exit 0
 }
 
 case "$1" in
-    ipreallocated)
+ipreallocated)
        all_ips=$($CTDB -X ip | tail -n +2)
 
        # Block the iSCSI port.  Only block for the address families
@@ -74,12 +74,12 @@ EOF
 
        ;;
 
-    shutdown)
+shutdown)
        # Shutdown iSCSI daemon when ctdb goes down
        killall -9 tgtd >/dev/null 2>&1
        ;;
 
-    monitor)
+monitor)
        ctdb_check_tcp_ports 3260 || exit $?
        ;;
 esac
index 2c70599d25cd5857837bbb86c30d4543217574c7..4aa594085d823cb48aed24a4d95725f32371e8ca 100755 (executable)
@@ -14,7 +14,7 @@ loadconfig ctdb
 [ "$CTDB_RUN_TIMEOUT_MONITOR" = "yes" ] || exit 0
 
 case "$1" in
-    monitor)
+monitor)
        TIMEOUT=$($CTDB getvar EventScriptTimeout | awk '{print $3}')
        echo "sleeping for $((TIMEOUT * 2)) seconds..."
        sleep $((TIMEOUT * 2))