The branch, master has been updated
       via  abeb65ef02d018a7c14d4f8cea71e15c6cf9e357 (commit)
       via  5d0215be5aefe492258a92c7bff2d41960379580 (commit)
       via  4ba7c73eeab98296c9168e0b0fed1f6bb9f32733 (commit)
       via  4369c8e6ead9062ef7855ada375df74262acf925 (commit)
       via  cd6227aa38d3bb4e5043faeffe436004e27b6d06 (commit)
       via  b7aaa28b3a6a2de923417f3d143f8d516447711e (commit)
       via  b953524185632d7f96a76d8f3bbed7ac1d143d40 (commit)
       via  f1b7ca8dc3f34a59c7b3e55748f974ac9ed8f458 (commit)
       via  b32fd04bfbf33062d45365b37a7247e272a76ceb (commit)
       via  9ea57af557028b1d2e5c560e7bcf4d014b9a8b1e (commit)
       via  aabf0bf41cb8ec344f06b69492fb6c2a27f9e900 (commit)
       via  3b11b27f3e22e99947bc2d6c49c4427bd7a0e332 (commit)
       via  c3e7a6e10d486ba0dbafdf110db540675b2317bc (commit)
       via  f3dd2eec200d6eeada2ea19cd7e76f1edfad6167 (commit)
       via  3bc93f312b8464fbfa2b2c44fffedc591fe5a3e0 (commit)
       via  0b77cceb49a30a181063adc7868d42d2851318e8 (commit)
       via  5ffce65a1ad659b198ddf647622b899bdde45c72 (commit)
       via  0b67397ef5419c781a35916575151da7b7e7cc27 (commit)
       via  0a0c8543f167e11b75a622513367b083e42cbd3f (commit)
      from  c48583fd238496a81ddc46a21892f0b49559036a (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit abeb65ef02d018a7c14d4f8cea71e15c6cf9e357
Author: Martin Schwenke <mar...@meltin.net>
Date:   Fri Jun 21 14:49:20 2013 +1000

    doc: Fix ctdb ping entry in manpage
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit 5d0215be5aefe492258a92c7bff2d41960379580
Author: Martin Schwenke <mar...@meltin.net>
Date:   Fri Jun 21 14:47:20 2013 +1000

    doc: Fix documentation for NoIPTakeover in ctdbd manpage
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit 4ba7c73eeab98296c9168e0b0fed1f6bb9f32733
Author: Martin Schwenke <mar...@meltin.net>
Date:   Fri Jun 21 14:33:12 2013 +1000

    doc: Update notification script section in ctdbd manpage
    
    The example notification script is now much more useful.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit 4369c8e6ead9062ef7855ada375df74262acf925
Author: Martin Schwenke <mar...@meltin.net>
Date:   Fri Jun 21 14:32:50 2013 +1000

    doc: Add nodestatus command to the ctdb manpage
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit cd6227aa38d3bb4e5043faeffe436004e27b6d06
Author: Martin Schwenke <mar...@meltin.net>
Date:   Fri Jun 21 10:52:05 2013 +1000

    doc: Update NEWS
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit b7aaa28b3a6a2de923417f3d143f8d516447711e
Author: Martin Schwenke <mar...@meltin.net>
Date:   Thu Jun 20 16:43:10 2013 +1000

    tests: Integration tests use "ctdb nodestatus" for healthy cluster check
    
    Also check that we're not in recovery mode.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit b953524185632d7f96a76d8f3bbed7ac1d143d40
Author: Martin Schwenke <mar...@meltin.net>
Date:   Thu Jun 20 16:42:30 2013 +1000

    tests: Integration test infrastructure should do only a single recovery
    
    No need for 2 recoveries after a restart.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit f1b7ca8dc3f34a59c7b3e55748f974ac9ed8f458
Author: Martin Schwenke <mar...@meltin.net>
Date:   Sat Jun 22 15:44:28 2013 +1000

    ctdbd: Fix panic on overlapping shutdowns
    
    The runstate can't be set to SHUTDOWN twice, so the current naive code
    causes a panic on the 2nd shutdown.  This regression was introduced in
    commit 8076773a9924dcf8aff16f7d96b2b9ac383ecc28.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit b32fd04bfbf33062d45365b37a7247e272a76ceb
Author: Martin Schwenke <mar...@meltin.net>
Date:   Wed Jun 19 10:58:14 2013 +1000

    ctdbd: Refactor shutdown sequence
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit 9ea57af557028b1d2e5c560e7bcf4d014b9a8b1e
Author: Martin Schwenke <mar...@meltin.net>
Date:   Sun Jun 16 21:01:43 2013 +1000

    eventscripts: "setup" event doesn't need to wait for SETUP runstate
    
    The "setup" event isn't called until ctdbd is in CTDB_RUNSTATE_SETUP
    anyway...
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit aabf0bf41cb8ec344f06b69492fb6c2a27f9e900
Author: Martin Schwenke <mar...@meltin.net>
Date:   Tue Jun 18 15:07:26 2013 +1000

    tests/eventscripts: New tests for 00.ctdb "init" event
    
    These test dropping of IPs and TDB checking.
    
    New stubs for date, tdbdump, tdbtool.
    
    Enhance ip stub to handle "ip addr show to ..."
    
    Tweak some infrastructure.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>
    Pair-programmed-with: Amitay Isaacs <ami...@gmail.com>

commit 3b11b27f3e22e99947bc2d6c49c4427bd7a0e332
Author: Martin Schwenke <mar...@meltin.net>
Date:   Tue Jun 18 15:02:05 2013 +1000

    eventscripts: 13.per_ip_routing should not try hard to find public_addresses
    
    This essentially reverts d4621277240721e6d130a930b0100506b64467ea.
    This was added for testing but the test code was actually broken.
    CTDB itself will only process public IPs if $CTDB_PUBLIC_ADDRESSES is
    set, so no code should try to be more flexible than that!
    
    The test code has been fixed instead.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit c3e7a6e10d486ba0dbafdf110db540675b2317bc
Author: Martin Schwenke <mar...@meltin.net>
Date:   Tue Jun 18 15:05:39 2013 +1000

    tests/eventscripts: setup_ctdb() should always set $CTDB_PUBLIC_ADDRESSES
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>
    Pair-programmed-with: Amitay Isaacs <ami...@gmail.com>

commit f3dd2eec200d6eeada2ea19cd7e76f1edfad6167
Author: Martin Schwenke <mar...@meltin.net>
Date:   Mon Jun 17 15:14:53 2013 +1000

    logging: Notify parent when logging daemon is up
    
    Messages are lost until it is really up because syslogd_is_started is
    set too early.  Adding a pipe to do the notification allows the parent
    to wait and only set syslogd_is_started when the logging daemon is
    actually ready.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>
    Pair-programmed-with: Amitay Isaacs <ami...@gmail.com>

commit 3bc93f312b8464fbfa2b2c44fffedc591fe5a3e0
Author: Martin Schwenke <mar...@meltin.net>
Date:   Mon Jun 17 10:14:24 2013 +1000

    scripts: Move TDB checking from initscript to "init" event
    
    It makes sense to do this in the "init" event and make the initscript
    less complicated.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit 0b77cceb49a30a181063adc7868d42d2851318e8
Author: Martin Schwenke <mar...@meltin.net>
Date:   Sun Jun 16 20:29:33 2013 +1000

    scripts: Move dropping of all IPs from initscript to "init" event
    
    It makes sense to do this in the "init" event and make the initscript
    less complicated.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit 5ffce65a1ad659b198ddf647622b899bdde45c72
Author: Martin Schwenke <mar...@meltin.net>
Date:   Tue Jun 18 14:53:17 2013 +1000

    scripts: drop_ip() should use delete_ip_from_iface()
    
    Otherwise secondary addresses that aren't owned by CTDB could be
    dropped.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit 0b67397ef5419c781a35916575151da7b7e7cc27
Author: Martin Schwenke <mar...@meltin.net>
Date:   Sun Jun 16 20:24:10 2013 +1000

    scripts: drop_all_public_ips() now prints messages to stdout, not log
    
    Change all callers to maintain current behaviour.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>

commit 0a0c8543f167e11b75a622513367b083e42cbd3f
Author: Martin Schwenke <mar...@meltin.net>
Date:   Sun Jun 16 19:49:02 2013 +1000

    ctdbd: "init" event should run earlier in daemon initialisation
    
    It should run before:
    
    * the transport is started;
    * databases are attached; and
    * processing configuration files (e.g. nodes, public_addresses).
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>
    Pair-programmed-with: Amitay Isaacs <ami...@gmail.com>

-----------------------------------------------------------------------

Summary of changes:
 NEWS                                               |   26 +++++
 config/ctdb-crash-cleanup.sh                       |    2 +-
 config/ctdb.init                                   |  103 +------------------
 config/events.d/00.ctdb                            |  113 +++++++++++++++++---
 config/events.d/13.per_ip_routing                  |    2 +-
 config/functions                                   |   12 +--
 doc/ctdb.1.xml                                     |   70 ++++++++++++-
 doc/ctdbd.1.xml                                    |   14 ++-
 include/ctdb_private.h                             |    2 +
 server/ctdb_control.c                              |   15 +--
 server/ctdb_daemon.c                               |   36 +++++--
 server/ctdb_logging.c                              |   40 ++++++--
 server/ctdb_monitor.c                              |   13 +--
 tests/eventscripts/00.ctdb.init.001.sh             |   13 +++
 tests/eventscripts/00.ctdb.init.002.sh             |   17 +++
 tests/eventscripts/00.ctdb.init.003.sh             |   16 +++
 tests/eventscripts/00.ctdb.init.004.sh             |   22 ++++
 tests/eventscripts/00.ctdb.init.005.sh             |   20 ++++
 tests/eventscripts/00.ctdb.init.006.sh             |   25 +++++
 tests/eventscripts/00.ctdb.init.007.sh             |   16 +++
 tests/eventscripts/00.ctdb.init.008.sh             |   19 ++++
 ...nterface.startup.002.sh => 00.ctdb.init.021.sh} |    2 +-
 tests/eventscripts/00.ctdb.init.022.sh             |   18 +++
 tests/eventscripts/00.ctdb.init.023.sh             |   23 ++++
 tests/eventscripts/scripts/local.sh                |   11 ++-
 tests/eventscripts/stubs/date                      |    7 ++
 tests/eventscripts/stubs/ip                        |   25 ++++-
 tests/eventscripts/stubs/tdbdump                   |    9 ++
 tests/eventscripts/stubs/tdbtool                   |   15 +++
 tests/scripts/integration.bash                     |   21 +----
 30 files changed, 531 insertions(+), 196 deletions(-)
 create mode 100755 tests/eventscripts/00.ctdb.init.001.sh
 create mode 100755 tests/eventscripts/00.ctdb.init.002.sh
 create mode 100755 tests/eventscripts/00.ctdb.init.003.sh
 create mode 100755 tests/eventscripts/00.ctdb.init.004.sh
 create mode 100755 tests/eventscripts/00.ctdb.init.005.sh
 create mode 100755 tests/eventscripts/00.ctdb.init.006.sh
 create mode 100755 tests/eventscripts/00.ctdb.init.007.sh
 create mode 100755 tests/eventscripts/00.ctdb.init.008.sh
 copy tests/eventscripts/{10.interface.startup.002.sh => 00.ctdb.init.021.sh} 
(59%)
 create mode 100755 tests/eventscripts/00.ctdb.init.022.sh
 create mode 100755 tests/eventscripts/00.ctdb.init.023.sh
 create mode 100755 tests/eventscripts/stubs/date
 create mode 100755 tests/eventscripts/stubs/tdbdump
 create mode 100755 tests/eventscripts/stubs/tdbtool


Changeset truncated at 500 lines:

diff --git a/NEWS b/NEWS
index b4a6169..8056d18 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,29 @@
+Changes in CTDB 2.3
+===================
+
+User-visible changes
+--------------------
+
+* 2 new configuration variables for 60.nfs eventscript:
+
+  - CTDB_MONITOR_NFS_THREAD_COUNT
+  - CTDB_NFS_DUMP_STUCK_THREADS
+
+  See ctdb.sysconfig for details.
+
+Important bug fixes
+-------------------
+
+* ctdb tool should not exit from a retry loop if a control times out
+  (e.g. under high load).  This simple fix will stop an exit from the
+  retry loop on any error.
+
+Important internal changes
+--------------------------
+
+*
+
+
 Changes in CTDB 2.2
 ===================
 
diff --git a/config/ctdb-crash-cleanup.sh b/config/ctdb-crash-cleanup.sh
index d26838e..78eaa93 100755
--- a/config/ctdb-crash-cleanup.sh
+++ b/config/ctdb-crash-cleanup.sh
@@ -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"
diff --git a/config/ctdb.init b/config/ctdb.init
index 2ceb45f..b5ecd69 100755
--- a/config/ctdb.init
+++ b/config/ctdb.init
@@ -120,98 +120,6 @@ export_debug_variables ()
     export CTDB_DEBUG_HUNG_SCRIPT CTDB_EXTERNAL_TRACE
 }
 
-# Log given message or stdin to either syslog or a CTDB log file
-do_log ()
-{
-    script_log "ctdb.init" "$@"
-}
-
-select_tdb_checker ()
-{
-    # Find the best TDB consistency check available.
-    use_tdb_tool_check=false
-    if which tdbtool >/dev/null 2>&1 && \
-       echo "help" | tdbtool | grep -q check ; then
-
-       use_tdb_tool_check=true
-    elif which tdbtool >/dev/null 2>&1 && which tdbdump >/dev/null 2>&1 ; then
-           do_log <<EOF
-WARNING: The installed 'tdbtool' does not offer the 'check' subcommand.
- Using 'tdbdump' for database checks.
- Consider updating 'tdbtool' for better checks!
-EOF
-    elif which tdbdump >/dev/null 2>&1 ; then
-       do_log <<EOF
-WARNING: 'tdbtool' is not available.
- Using 'tdbdump' to check the databases.
- Consider installing a recent 'tdbtool' for better checks!
-EOF
-    else
-       do_log <<EOF
-WARNING: Cannot check databases since neither
- 'tdbdump' nor 'tdbtool check' is available.
- Consider installing tdbtool or at least tdbdump!
-EOF
-        return 1
-    fi
-}
-
-check_tdb ()
-{
-    _db="$1"
-
-    if $use_tdb_tool_check ; then
-       # tdbtool always exits with 0  :-(
-       if tdbtool "$_db" check 2>/dev/null |
-           grep -q "Database integrity is OK" ; then
-           return 0
-       else
-           return 1
-       fi
-    else
-       tdbdump "$_db" >/dev/null 2>/dev/null
-       return $?
-    fi
-}
-
-check_persistent_databases ()
-{
-    _dir="${CTDB_DBDIR_PERSISTENT:-${CTDB_DBDIR:-/var/ctdb}/persistent}"
-    mkdir -p "$_dir" 2>/dev/null
-
-    [ "${CTDB_MAX_PERSISTENT_CHECK_ERRORS:-0}" = "0" ] || return 0
-
-    for _db in $(ls "$_dir/"*.tdb.*[0-9] 2>/dev/null) ; do
-       check_tdb $_db || {
-           do_log "Persistent database $_db is corrupted! CTDB will not start."
-           return 1
-       }
-    done
-}
-
-check_non_persistent_databases ()
-{
-    _dir="${CTDB_DBDIR:-/var/ctdb}"
-    mkdir -p "$_dir" 2>/dev/null
-
-    for _db in $(ls "${_dir}/"*.tdb.*[0-9] 2>/dev/null) ; do
-       check_tdb $_db || {
-           _backup="${_db}.$(date +'%Y%m%d.%H%M%S.%N').corrupt"
-           do_log <<EOF
-WARNING: database ${_db} is corrupted.
- Moving to backup ${_backup} for later analysis.
-EOF
-           mv "$_db" "$_backup"
-
-           # Now remove excess backups
-           ls -td "${_db}."*".corrupt" |
-           tail -n +$((${CTDB_MAX_CORRUPT_DB_BACKUPS:-10} + 1)) |
-           xargs rm -f
-           
-       }
-    done
-}
-
 set_retval() {
     return $1
 }
@@ -247,15 +155,6 @@ start() {
 
     export_debug_variables
 
-    # 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"
-
-    if select_tdb_checker ; then
-       check_persistent_databases || return $?
-       check_non_persistent_databases
-    fi
-
     if [ "$CTDB_SUPPRESS_COREFILE" = "yes" ]; then
        ulimit -c 0
     else
@@ -334,7 +233,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"
 
diff --git a/config/events.d/00.ctdb b/config/events.d/00.ctdb
index 02d1569..d56c7c4 100755
--- a/config/events.d/00.ctdb
+++ b/config/events.d/00.ctdb
@@ -17,7 +17,94 @@ loadconfig
 
 ctdb_setup_service_state_dir "ctdb"
 
-#
+############################################################
+
+select_tdb_checker ()
+{
+    # Find the best TDB consistency check available.
+    use_tdb_tool_check=false
+    if which tdbtool >/dev/null 2>&1 && \
+       echo "help" | tdbtool | grep -q check ; then
+
+       use_tdb_tool_check=true
+    elif which tdbtool >/dev/null 2>&1 && which tdbdump >/dev/null 2>&1 ; then
+           cat <<EOF
+WARNING: The installed 'tdbtool' does not offer the 'check' subcommand.
+ Using 'tdbdump' for database checks.
+ Consider updating 'tdbtool' for better checks!
+EOF
+    elif which tdbdump >/dev/null 2>&1 ; then
+       cat <<EOF
+WARNING: 'tdbtool' is not available.
+ Using 'tdbdump' to check the databases.
+ Consider installing a recent 'tdbtool' for better checks!
+EOF
+    else
+       cat <<EOF
+WARNING: Cannot check databases since neither
+ 'tdbdump' nor 'tdbtool check' is available.
+ Consider installing tdbtool or at least tdbdump!
+EOF
+        return 1
+    fi
+}
+
+check_tdb ()
+{
+    _db="$1"
+
+    if $use_tdb_tool_check ; then
+       # tdbtool always exits with 0  :-(
+       if tdbtool "$_db" check 2>/dev/null |
+           grep -q "Database integrity is OK" ; then
+           return 0
+       else
+           return 1
+       fi
+    else
+       tdbdump "$_db" >/dev/null 2>/dev/null
+       return $?
+    fi
+}
+
+check_persistent_databases ()
+{
+    _dir="${CTDB_DBDIR_PERSISTENT:-${CTDB_DBDIR:-/var/ctdb}/persistent}"
+    mkdir -p "$_dir" 2>/dev/null
+
+    [ "${CTDB_MAX_PERSISTENT_CHECK_ERRORS:-0}" = "0" ] || return 0
+
+    for _db in $(ls "$_dir/"*.tdb.*[0-9] 2>/dev/null) ; do
+       check_tdb $_db || {
+           echo "Persistent database $_db is corrupted! CTDB will not start."
+           return 1
+       }
+    done
+}
+
+check_non_persistent_databases ()
+{
+    _dir="${CTDB_DBDIR:-/var/ctdb}"
+    mkdir -p "$_dir" 2>/dev/null
+
+    for _db in $(ls "${_dir}/"*.tdb.*[0-9] 2>/dev/null) ; do
+       check_tdb $_db || {
+           _backup="${_db}.$(date +'%Y%m%d.%H%M%S.%N').corrupt"
+           cat <<EOF
+WARNING: database ${_db} is corrupted.
+ Moving to backup ${_backup} for later analysis.
+EOF
+           mv "$_db" "$_backup"
+
+           # Now remove excess backups
+           ls -td "${_db}."*".corrupt" |
+           tail -n +$((${CTDB_MAX_CORRUPT_DB_BACKUPS:-10} + 1)) |
+           xargs rm -f
+           
+       }
+    done
+}
+
 update_config_from_tdb() {
 
     # Pull optional ctdb configuration data out of config.tdb
@@ -49,18 +136,7 @@ set_ctdb_variables () {
     done
 }
 
-wait_until_ready () {
-    _timeout="${1:-10}" # default is 10 seconds
-
-    _count=0
-    while ! ctdb runstate setup >/dev/null 2>&1 ; do
-       if [ $_count -ge $_timeout ] ; then
-           return 1
-       fi
-       sleep 1
-       _count=$(($_count + 1))
-    done
-}
+############################################################
 
 ctdb_check_args "$@"
 
@@ -75,11 +151,18 @@ case "$1" in
            echo "mkdir -p $CTDB_VARDIR/state - failed - $ret"
            exit $ret
        }
+
+       # 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
+
+       if select_tdb_checker ; then
+           check_persistent_databases || exit $?
+           check_non_persistent_databases
+       fi
        ;;
 
      setup)
-        # Make sure CTDB daemon is ready to process requests
-       wait_until_ready || die "CTDB did not become ready for setup"
        # Set any tunables from the config file
        set_ctdb_variables || die "Failed to set CTDB tunables"
        ;;
diff --git a/config/events.d/13.per_ip_routing 
b/config/events.d/13.per_ip_routing
index 4b13546..de153a6 100755
--- a/config/events.d/13.per_ip_routing
+++ b/config/events.d/13.per_ip_routing
@@ -191,7 +191,7 @@ get_config_for_ip ()
            if [ "$_ip" = "$_i" ] ; then
                echo -n "$_ip "; ipv4_host_addr_to_net "$_ip" "$_maskbits"
            fi
-       done 
<"${CTDB_PUBLIC_ADDRESSES:-${CTDB_BASE:-/dev/null}${CTDB_BASE:+/public_addresses}}"
+       done <"${CTDB_PUBLIC_ADDRESSES:-/dev/null}"
     else
        while read _i _rest ; do
            if [ "$_ip" = "$_i" ] ; then
diff --git a/config/functions b/config/functions
index 0a806cb..d0d87ee 100755
--- a/config/functions
+++ b/config/functions
@@ -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
-       ip addr del $_addr/$_maskbits dev $_iface >/dev/null 2>&1
+       echo "Removing public address $_addr/$_maskbits from device $_iface"
+       delete_ip_from_iface $_iface $_addr $_maskbits >/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}"
 }
 
diff --git a/doc/ctdb.1.xml b/doc/ctdb.1.xml
index ce83a3e..c854619 100644
--- a/doc/ctdb.1.xml
+++ b/doc/ctdb.1.xml
@@ -324,6 +324,71 @@ Recovery master:0
       </screen>
     </refsect2>
 
+    <refsect2><title>nodestatus [&lt;nodespec&gt;]</title>
+      <para>
+        This command is similar to the <command>status</command>
+        command.  It displays the "node status" subset of output.  The
+        main differences are:
+      </para>
+
+      <itemizedlist>
+       <listitem>
+         <para>
+           The exit code is the bitwise-OR of the flags for each
+           specified node, while <command>ctdb status</command> exits
+           with 0 if it was able to retrieve status for all nodes.
+         </para>
+       </listitem>
+
+       <listitem>
+         <para>
+           <command>ctdb status</command> provides status information
+           for all nodes.  <command>ctdb nodestatus</command>
+           defaults to providing status for only the current node.
+           If &lt;nodespec&gt; is provided then status is given for
+           the indicated node(s).
+         </para>
+
+         <para>
+           By default, <command>ctdb nodestatus</command> gathers
+           status from the local node.  However, if invoked with "-n
+           all" (or similar) then status is gathered from the given
+           node(s).  In particular <command>ctdb nodestatus
+           all</command> and <command>ctdb nodestatus -n
+           all</command> will produce different output.  It is
+           possible to provide 2 different nodespecs (with and
+           without "-n") but the output is usually confusing!
+         </para>
+       </listitem>
+      </itemizedlist>
+
+      <para>
+       A common invocation in scripts is <command>ctdb nodestatus
+       all</command> to check whether all nodes in a cluster are
+       healthy.
+      </para>
+
+      <para>
+       Example: ctdb nodestatus
+      </para>
+      <para>Example output:</para>
+      <screen format="linespecific">
+# ctdb nodestatus
+pnn:0 10.0.0.30        OK (THIS NODE)
+      </screen>
+
+      <para>
+       Example: ctdb nodestatus all
+      </para>
+      <para>Example output:</para>
+      <screen format="linespecific">
+# ctdb nodestatus all
+Number of nodes:2
+pnn:0 10.0.0.30        OK (THIS NODE)
+pnn:1 10.0.0.31        OK
+      </screen>
+    </refsect2>
+
     <refsect2><title>recmaster</title>
       <para>
         This command shows the pnn of the node which is currently the 
recmaster.
@@ -366,10 +431,11 @@ Duration of last recovery/failover: 2.248552 seconds
 
     <refsect2><title>ping</title>
       <para>
-        This command will "ping" all CTDB daemons in the cluster to verify 
that they are processing commands correctly.
+        This command will "ping" specified CTDB node in the cluster to
+        verify that they are running.
       </para>
       <para>
-       Example: ctdb ping
+       Example: ctdb ping -n all
       </para>
       <para>
        Example output:
diff --git a/doc/ctdbd.1.xml b/doc/ctdbd.1.xml
index 9516164..5b803b6 100644
--- a/doc/ctdbd.1.xml
+++ b/doc/ctdbd.1.xml
@@ -856,9 +856,10 @@
     <refsect2><title>NoIPTakeover</title>
     <para>Default: 0</para>
     <para>
-    When set to 1, ctdb will allow ip addresses to be failed over onto this
-    node. Any ip addresses that the node currently hosts will remain on the
-    node but no new ip addresses can be failed over onto the node.
+    When set to 1, ctdb will not allow IP addresses to be failed over
+    onto this node. Any IP addresses that the node currently hosts
+    will remain on the node but no new IP addresses can be failed over
+    to the node.
     </para>
     </refsect2>
 
@@ -1696,7 +1697,12 @@ CTDB_CAPABILITY_RECMASTER=no
        sysconfig file, or by adding --notification-script=&lt;your script&gt;.
     </para>
     <para>
-      See /etc/ctdb/notify.sh for an example script.
+      See /etc/ctdb/notify.sh for an example script.  This script
+      executes files in <filename>/etc/ctdb/notify.d/</filename>, so
+      it is recommended that you handle notifications using the
+      example script and by place executable scripts in
+      <filename>/etc/ctdb/notify.d/</filename> to handle the desired
+      notifications.
     </para>
     <para>
       CTDB currently generates notifications on these state changes:
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index eadd963..bf5b5ec 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -450,6 +450,8 @@ const char *runstate_to_string(enum ctdb_runstate runstate);
 enum ctdb_runstate runstate_from_string(const char *label);
 void ctdb_set_runstate(struct ctdb_context *ctdb, enum ctdb_runstate runstate);
 
+void ctdb_shutdown_sequence(struct ctdb_context *ctdb, int exit_code);
+
 #define CTDB_MONITORING_ACTIVE         0
 #define CTDB_MONITORING_DISABLED       1
 
diff --git a/server/ctdb_control.c b/server/ctdb_control.c
index 229ccdd..a8771f3 100644


-- 
CTDB repository

Reply via email to