The branch, master has been updated via 110e72c ctdb-scripts: Drop CTDB_RC_LOCAL testing hook via 26430ab ctdb-scripts: Drop unused variable service_config via dbc6ebc ctdb-docs: Drop documentation for CTDB_SHUTDOWN_TIMEOUT option via 072650b ctdb-docs: Drop stale reference to unused configuration file via 3388aed ctdb-docs: Drop references to CTDB_BASE from the documentation via d44fed6 ctdb-tools: Avoid filtering stderr when onnode not running in parallel via d8741fe ctdb-scripts: Avoid shellcheck SC1117: Backslash is literal in "..." via 7dbf833 ctdb: Fix some -Werror=strict-overflow issues from 5757d25 script/git-hooks: add check-trailing-whitespace
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 110e72ccd8e241cb8bed7e257ee9d96767fd9e24 Author: Martin Schwenke <mar...@meltin.net> Date: Thu Apr 5 16:09:22 2018 +1000 ctdb-scripts: Drop CTDB_RC_LOCAL testing hook This is not used. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> Autobuild-User(master): Amitay Isaacs <ami...@samba.org> Autobuild-Date(master): Fri Apr 27 09:37:49 CEST 2018 on sn-devel-144 commit 26430ab1d1d5edb64cd6c9fe279e5beb264a1c38 Author: Martin Schwenke <mar...@meltin.net> Date: Wed Apr 4 19:00:56 2018 +1000 ctdb-scripts: Drop unused variable service_config This was previously used by the loadconfig() function. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit dbc6ebc6244c2c409bbbb31ef922a7eab93d6f6a Author: Martin Schwenke <mar...@meltin.net> Date: Wed Apr 4 18:17:13 2018 +1000 ctdb-docs: Drop documentation for CTDB_SHUTDOWN_TIMEOUT option This was recently removed but the documentation was forgotten. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit 072650b40e79f407c16144ab441c26f469d89d29 Author: Martin Schwenke <mar...@meltin.net> Date: Thu Mar 29 15:42:10 2018 +1100 ctdb-docs: Drop stale reference to unused configuration file Recently removed but documentation change was forgotten. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit 3388aed012d269ee896a71bddcc5570f16b92d6a Author: Martin Schwenke <mar...@meltin.net> Date: Thu Mar 29 15:38:13 2018 +1100 ctdb-docs: Drop references to CTDB_BASE from the documentation CTDB_BASE should only ever be modified by test code. It should not be mentioned in the user documentation. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit d44fed601d4e867cd2d282df5673753d2aefb0c9 Author: Martin Schwenke <mar...@meltin.net> Date: Wed Apr 18 08:05:25 2018 +1000 ctdb-tools: Avoid filtering stderr when onnode not running in parallel stderr_filter() only does anything useful when running in parallel (i.e. with the -p option). So, simplify the non-parallel case by not using stderr_filter(). As a side-effect, this fixes an issue introduced in commit 85a4375788d8ef8345ec390807f18299abdadb20 where local daemon tests would hang when trying to start daemons with VALGRIND set (to a valgrind command that does not use --log-file). This is because valgrind would keep stderr open for its output so the pipeline involving stderr_filter() would never complete. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit d8741feec533934e02bd54b7bcc4fb71dbe1a1e1 Author: Martin Schwenke <mar...@meltin.net> Date: Thu Apr 19 11:54:26 2018 +1000 ctdb-scripts: Avoid shellcheck SC1117: Backslash is literal in "..." This warning (apparently new in shellcheck 0.4.7) only applies to double-quoted strings. Change affected constant strings to use single-quotes. In the one example that contains a variable expansion escape the backslash as recommended. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit 7dbf83369705bf2fe7c4d6b79ddf794ea8adb5db Author: Martin Schwenke <mar...@meltin.net> Date: Mon Apr 16 18:32:07 2018 +1000 ctdb: Fix some -Werror=strict-overflow issues All quite obvious. For the LCP2 one, we're not actually counting so use a bool instead of an int. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> ----------------------------------------------------------------------- Summary of changes: ctdb/config/debug-hung-script.sh | 2 +- ctdb/config/debug_locks.sh | 4 +-- ctdb/config/events.d/10.interface | 6 ++--- ctdb/config/events.d/13.per_ip_routing | 4 +-- ctdb/config/events.d/31.clamd | 6 ----- ctdb/config/events.d/41.httpd | 6 ----- ctdb/config/functions | 4 --- ctdb/doc/ctdbd.conf.5.xml | 46 ++-------------------------------- ctdb/doc/onnode.1.xml | 19 +------------- ctdb/server/ctdb_recovery_helper.c | 5 ++-- ctdb/server/ipalloc_lcp2.c | 10 +++++--- ctdb/tools/ctdb.c | 3 ++- ctdb/tools/ctdb_natgw | 2 +- ctdb/tools/onnode | 7 +----- 14 files changed, 24 insertions(+), 100 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/config/debug-hung-script.sh b/ctdb/config/debug-hung-script.sh index dc9c6e1..d6ff833 100755 --- a/ctdb/config/debug-hung-script.sh +++ b/ctdb/config/debug-hung-script.sh @@ -36,7 +36,7 @@ fi default_pat='exportfs|rpcinfo' pat="${CTDB_DEBUG_HUNG_SCRIPT_STACKPAT:-${default_pat}}" echo "$out" | - sed -r -n "s@.*-(.*(${pat}).*),([0-9]*).*@\3 \1@p" | + sed -r -n "s@.*-(.*(${pat}).*),([0-9]*).*@\\3 \\1@p" | while read pid name ; do trace=$(cat "/proc/${pid}/stack" 2>/dev/null) # No! Checking the exit code afterwards is actually clearer... diff --git a/ctdb/config/debug_locks.sh b/ctdb/config/debug_locks.sh index 0f8aaad..3feb121 100755 --- a/ctdb/config/debug_locks.sh +++ b/ctdb/config/debug_locks.sh @@ -39,7 +39,7 @@ loadconfig while read pid rest ; do pname=$(readlink "/proc/${pid}/exe") echo "$pid $pname $rest" - done | sed -e "$sed_cmd" | grep "\.tdb" ) + done | sed -e "$sed_cmd" | grep '\.tdb' ) if [ -n "$out" ]; then # Log information about locks @@ -54,7 +54,7 @@ loadconfig done # Use word splitting to squash whitespace # shellcheck disable=SC2086 - pids=$(echo $all_pids | tr " " "\n" | sort -u) + pids=$(echo $all_pids | tr ' ' '\n' | sort -u) # For each process waiting, log stack trace for pid in $pids ; do diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface index 28a7e5b..72e0c10 100755 --- a/ctdb/config/events.d/10.interface +++ b/ctdb/config/events.d/10.interface @@ -25,9 +25,9 @@ fi get_all_interfaces () { # Get all the interfaces listed in the public_addresses file - all_interfaces=$(sed -e "s/^[^\t ]*[\t ]*//" \ - -e "s/,/ /g" \ - -e "s/[\t ]*$//" "$ctdb_public_addresses") + all_interfaces=$(sed -e 's/^[^\t ]*[\t ]*//' \ + -e 's/,/ /g' \ + -e 's/[\t ]*$//' "$ctdb_public_addresses") # Get the interfaces for which CTDB has public IPs configured. # That is, for all but the 1st line, get the 1st field. diff --git a/ctdb/config/events.d/13.per_ip_routing b/ctdb/config/events.d/13.per_ip_routing index ae5a0b9..2698294 100755 --- a/ctdb/config/events.d/13.per_ip_routing +++ b/ctdb/config/events.d/13.per_ip_routing @@ -158,7 +158,7 @@ ensure_table_id_for_ip () # If the new table id is legal then add it to the file and # print it. if [ "$_new" -le "$CTDB_PER_IP_ROUTING_TABLE_ID_HIGH" ] ; then - printf "%d\t%s\n" "$_new" "$_label" >>"$rt_tables" + printf '%d\t%s\n' "$_new" "$_label" >>"$rt_tables" return 0 else return 1 @@ -211,7 +211,7 @@ get_config_for_ip () else while read _i _rest ; do if [ "$_ip" = "$_i" ] ; then - printf "%s\t%s\n" "$_ip" "$_rest" + printf '%s\t%s\n' "$_ip" "$_rest" fi done <"$CTDB_PER_IP_ROUTING_CONF" fi diff --git a/ctdb/config/events.d/31.clamd b/ctdb/config/events.d/31.clamd index 1049c3b..e073608 100755 --- a/ctdb/config/events.d/31.clamd +++ b/ctdb/config/events.d/31.clamd @@ -11,15 +11,9 @@ detect_init_style case $CTDB_INIT_STYLE in redhat) service_name="clamd" - # service_config is used by loadconfig() - # shellcheck disable=SC2034 - service_config="clamd" ;; *) service_name="clamav" - # service_config is used by loadconfig() - # shellcheck disable=SC2034 - service_config="clamav" ;; esac diff --git a/ctdb/config/events.d/41.httpd b/ctdb/config/events.d/41.httpd index 73b8d0f..4030d7c 100755 --- a/ctdb/config/events.d/41.httpd +++ b/ctdb/config/events.d/41.httpd @@ -11,15 +11,9 @@ detect_init_style case $CTDB_INIT_STYLE in redhat) service_name="httpd" - # service_config is used by loadconfig() - # shellcheck disable=SC2034 - service_config="http" ;; suse|debian|*) service_name="apache2" - # service_config is used by loadconfig() - # shellcheck disable=SC2034 - service_config="apache2" ;; esac diff --git a/ctdb/config/functions b/ctdb/config/functions index 8728d99..020a19a 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -986,10 +986,6 @@ update_tickles () # load a site local config file ######################################################## -[ -n "$CTDB_RC_LOCAL" -a -x "$CTDB_RC_LOCAL" ] && { - . "$CTDB_RC_LOCAL" -} - [ -x "${CTDB_BASE}/rc.local" ] && { . "${CTDB_BASE}/rc.local" } diff --git a/ctdb/doc/ctdbd.conf.5.xml b/ctdb/doc/ctdbd.conf.5.xml index 05d1231..f0f903b 100644 --- a/ctdb/doc/ctdbd.conf.5.xml +++ b/ctdb/doc/ctdbd.conf.5.xml @@ -66,15 +66,6 @@ <variablelist> <varlistentry> - <term>CTDB_BASE=<parameter>DIRECTORY</parameter></term> - <listitem> - <para> - DIRECTORY containing CTDB scripts and configuration files. - </para> - </listitem> - </varlistentry> - - <varlistentry> <term>CTDB_INIT_STYLE=debian|redhat|suse</term> <listitem> <para> @@ -420,22 +411,6 @@ <variablelist> <varlistentry> - <term>CTDB_SHUTDOWN_TIMEOUT=<parameter>NUM</parameter></term> - <listitem> - <para> - NUM is the number of seconds to wait for - <citerefentry><refentrytitle>ctdbd</refentrytitle> - <manvolnum>1</manvolnum></citerefentry> to shut down - gracefully before giving up and killing it. - </para> - - <para> - Defaults is 30. - </para> - </listitem> - </varlistentry> - - <varlistentry> <term>CTDB_STARTUP_TIMEOUT=<parameter>NUM</parameter></term> <listitem> <para> @@ -1448,7 +1423,7 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 an event script times out. </para> <para> - Default is <filename><varname>CTDB_BASE</varname>/debug-hung-script.sh</filename>. + Default is <filename>/usr/local/etc/ctdb/debug-hung-script.sh</filename>. </para> </listitem> </varlistentry> @@ -1494,7 +1469,7 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 </para> <para> No default, usually - <filename><varname>CTDB_BASE</varname>/debug_locks.sh</filename>. + <filename>/usr/local/etc/ctdb/debug_locks.sh</filename>. </para> </listitem> </varlistentry> @@ -1542,22 +1517,6 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 </varlistentry> <varlistentry> - <term>CTDB_RC_LOCAL=<parameter>FILENAME</parameter></term> - <listitem> - <para> - FILENAME is a script fragment to be sourced by the - <filename>functions</filename> that is sourced by scripts. - On example use would be to override function definitions - in unit tests. As a sanity check, this file must be - executable for it to be used. - </para> - <para> - No default. - </para> - </listitem> - </varlistentry> - - <varlistentry> <term>CTDB_RUN_TIMEOUT_MONITOR=yes|no</term> <listitem> <para> @@ -1631,7 +1590,6 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 <member><filename>/usr/local/etc/ctdb/ctdbd.conf</filename></member> <member><filename>/etc/sysconfig/ctdb</filename></member> <member><filename>/etc/default/ctdb</filename></member> - <member><filename>/usr/local/etc/ctdb/sysconfig/ctdb</filename></member> </simplelist> </refsect1> diff --git a/ctdb/doc/onnode.1.xml b/ctdb/doc/onnode.1.xml index 7c45563..c9d56a9 100644 --- a/ctdb/doc/onnode.1.xml +++ b/ctdb/doc/onnode.1.xml @@ -234,22 +234,6 @@ </refsect1> <refsect1> - <title>ENVIRONMENT</title> - - <variablelist> - <varlistentry><term><envar>CTDB_BASE</envar></term> - <listitem> - <para> - Directory containing CTDB configuration files. The - default is <filename>/usr/local/etc/ctdb</filename>. - </para> - </listitem> - </varlistentry> - - </variablelist> - </refsect1> - - <refsect1> <title>FILES</title> <variablelist> @@ -264,8 +248,7 @@ is given precedence. If a relative path is specified and no corresponding file exists relative to the current directory then the file is - also searched for in the <filename>$CTDB_BASE</filename> - directory. + also searched for in the CTDB configuration directory. </para> <para> Otherwise the default is diff --git a/ctdb/server/ctdb_recovery_helper.c b/ctdb/server/ctdb_recovery_helper.c index 2a10b07..7495eb3 100644 --- a/ctdb/server/ctdb_recovery_helper.c +++ b/ctdb/server/ctdb_recovery_helper.c @@ -1068,7 +1068,7 @@ static struct tevent_req *push_database_send( struct tevent_req *req, *subreq; struct push_database_state *state; uint32_t *old_list, *new_list; - int old_count, new_count; + unsigned int old_count, new_count; int i; req = tevent_req_create(mem_ctx, &state, struct push_database_state); @@ -2359,7 +2359,8 @@ static void recovery_active_done(struct tevent_req *subreq) struct ctdb_req_control request; struct ctdb_vnn_map *vnnmap; int *err_list; - int ret, count, i; + int ret, i; + unsigned int count; bool status; status = ctdb_client_control_multi_recv(subreq, &ret, NULL, &err_list, diff --git a/ctdb/server/ipalloc_lcp2.c b/ctdb/server/ipalloc_lcp2.c index a57000f..565b58c 100644 --- a/ctdb/server/ipalloc_lcp2.c +++ b/ctdb/server/ipalloc_lcp2.c @@ -477,7 +477,8 @@ bool ipalloc_lcp2(struct ipalloc_state *ipalloc_state) { uint32_t *lcp2_imbalances; bool *rebalance_candidates; - int numnodes, num_rebalance_candidates, i; + int numnodes, i; + bool have_rebalance_candidates; bool ret = true; unassign_unsuitable_ips(ipalloc_state); @@ -500,13 +501,14 @@ bool ipalloc_lcp2(struct ipalloc_state *ipalloc_state) * continuing on... */ numnodes = ipalloc_state->num; - num_rebalance_candidates = 0; + have_rebalance_candidates = false; for (i=0; i<numnodes; i++) { if (rebalance_candidates[i]) { - num_rebalance_candidates++; + have_rebalance_candidates = true; + break; } } - if (num_rebalance_candidates == 0) { + if (!have_rebalance_candidates) { goto finished; } diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 0efd71e..e6c3764 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -3025,7 +3025,8 @@ static int control_tickle(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, if (argc == 0) { struct ctdb_connection_list *clist; - int i, num_failed; + int i; + unsigned int num_failed; /* Client first but the src/dst logic is confused */ ret = ctdb_connection_list_read(mem_ctx, false, &clist); diff --git a/ctdb/tools/ctdb_natgw b/ctdb/tools/ctdb_natgw index b176241..21744dd 100755 --- a/ctdb/tools/ctdb_natgw +++ b/ctdb/tools/ctdb_natgw @@ -152,7 +152,7 @@ nodes_list () # format string must contain no variables. Some shells will # expand a tab if it is in an argument but others won't. if [ -n "$_options" ] ; then - printf "%s\t%s\n" "$_ip" "$_options" + printf '%s\t%s\n' "$_ip" "$_options" else echo "$_ip" fi diff --git a/ctdb/tools/onnode b/ctdb/tools/onnode index c3ebfea..6104d61 100755 --- a/ctdb/tools/onnode +++ b/ctdb/tools/onnode @@ -368,13 +368,8 @@ for n in $nodes ; do if $verbose ; then echo >&2 ; echo ">> NODE: $n <<" >&2 fi - { - exec 3>&1 - { - $ssh_cmd "$n" "$command" 3>&- | - stdout_filter >&3 - } 2>&1 | stderr_filter + $ssh_cmd "$n" "$command" | stdout_filter } || retcode=$? fi done -- Samba Shared Repository