The branch, master has been updated via 1b5968f6be084590667f4f15ff3bef13ed9a2973 (commit) via 25a6fd784cde96f3d20a79f70b5589b5c4aca675 (commit) via 80b3cf2c652c6098390cdd0dbb3edc648f7df487 (commit) via 85e11b9b13b3add88c1b8957be51793cc1db4f2d (commit) via 194f7a0dec26d693a5f3e6734b1c82f61f8e4d19 (commit) via 11af486754bb04899e3dc544157bf70530e66cd1 (commit) via f2ef3510407fbad29908195c58e4160d5a81e8a4 (commit) via 0ca7a98ffef50cbd06849cfbf65fb4a3d668b7bd (commit) via b2654853ce9b7c18c5874b080bc94d3118078a5d (commit) via b2b572e9049c7138bd223226475bef8fe3e01f10 (commit) via c9e36f596c63c9af7f80d7cb8d7a5c6dcca4860a (commit) from e5a5ab53173d9aa4190ddf68c4ae316d4473eb56 (commit)
http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 1b5968f6be084590667f4f15ff3bef13ed9a2973 Author: Martin Schwenke <mar...@meltin.net> Date: Tue May 28 12:01:57 2013 +1000 eventscripts: Fix statd-callout update handling 60.nfs and 60.ganesha touch $statd_update_trigger every time they're run. This stops the statd-callout updates from ever being called. Make this logic self-contained and move it to new function nfs_statd_update() in the functions file. Call this in 60.nfs and 60.ganesha with the appropriate update period as the only argument. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reported-by: Poornima Gupte <poornima.gu...@in.ibm.com> commit 25a6fd784cde96f3d20a79f70b5589b5c4aca675 Author: Martin Schwenke <mar...@meltin.net> Date: Tue May 28 11:26:17 2013 +1000 tests/integration: Improve debug output for unhealthy cluster after restart Signed-off-by: Martin Schwenke <mar...@meltin.net> commit 80b3cf2c652c6098390cdd0dbb3edc648f7df487 Author: Martin Schwenke <mar...@meltin.net> Date: Mon May 27 15:16:28 2013 +1000 tests/scripts: Delete unused $rows and $ww variables from run_tests Signed-off-by: Martin Schwenke <mar...@meltin.net> commit 85e11b9b13b3add88c1b8957be51793cc1db4f2d Author: Martin Schwenke <mar...@meltin.net> Date: Tue May 28 14:19:32 2013 +1000 packaging: Create separate package for pcp pmda To build ctdb-pcp-pmda package, run packaging/RPM/makerpms.sh script with "--with pmda" option. Signed-off-by: Martin Schwenke <mar...@meltin.net> Pair-programmed-with: Amitay Isaacs <ami...@gmail.com> commit 194f7a0dec26d693a5f3e6734b1c82f61f8e4d19 Author: Martin Schwenke <mar...@meltin.net> Date: Tue May 28 14:16:02 2013 +1000 build: Separate autoconf macros for pmda The pmda stuff is no longer built by default even if the headers are available. To build, run "configure --enable-pmda". Signed-off-by: Martin Schwenke <mar...@meltin.net> Pair-programmed-with: Amitay Isaacs <ami...@gmail.com> commit 11af486754bb04899e3dc544157bf70530e66cd1 Author: Martin Schwenke <mar...@meltin.net> Date: Tue May 28 14:16:25 2013 +1000 build: Fix install paths for pcp pmda Signed-off-by: Martin Schwenke <mar...@meltin.net> Pair-programmed-with: Amitay Isaacs <ami...@gmail.com> commit f2ef3510407fbad29908195c58e4160d5a81e8a4 Author: Martin Schwenke <mar...@meltin.net> Date: Mon May 27 14:43:03 2013 +1000 packaging: makerpms.sh can take multiple arguments for rpmbuild Signed-off-by: Martin Schwenke <mar...@meltin.net> commit 0ca7a98ffef50cbd06849cfbf65fb4a3d668b7bd Author: Martin Schwenke <mar...@meltin.net> Date: Mon May 27 12:56:41 2013 +1000 eventscripts: Stop NAT gateway's delete_all() from polluting the log Every time a node that wasn't the NAT gateway master gets reconfigured something like this appears in the log: ctdbd: 11.natgw: Failed to del 10.0.1.139 on dev eth1 Since this usually fails it is better to mute the error than to have it pollute the log. Signed-off-by: Martin Schwenke <mar...@meltin.net> commit b2654853ce9b7c18c5874b080bc94d3118078a5d Author: Martin Schwenke <mar...@meltin.net> Date: Mon May 27 11:29:42 2013 +1000 recoverd: Backward compatibility for nodes without IPREALLOCATED control Consider the case of upgrading a cluster node by node, where some nodes are still running older versions of CTDB without the IPREALLOCATED control. If a "new" node takes over as recovery master and a failover occurs, then it will attempt to send IPREALLOCATED controls to all nodes. The "old" nodes will fail in a fairly nondescript way (result == -1). To try to handle this situation, fall back to the EVENTSCRIPT control to handle "ipreallocated". Only do this on the failed nodes. However, do not do this on nodes that timed out (they've probably implemented the control and we should call the regular fail_callback to get those nodes banned) or for stopped nodes (since they can't actually run the "ipreallocated" event via the EVENTSCRIPT control). Signed-off-by: Martin Schwenke <mar...@meltin.net> commit b2b572e9049c7138bd223226475bef8fe3e01f10 Author: Martin Schwenke <mar...@meltin.net> Date: Sat May 25 19:57:24 2013 +1000 scripts: Provide mktemp function for platforms without mktemp command This is needed for AIX and possibly others. Also provide a cheaper mktemp function is needed in the run_tests script. Signed-off-by: Martin Schwenke <mar...@meltin.net> commit c9e36f596c63c9af7f80d7cb8d7a5c6dcca4860a Author: Martin Schwenke <mar...@meltin.net> Date: Sat May 25 19:08:49 2013 +1000 tests: Fix integration tests to use real private IPs 192.0.2.x was a typo. Signed-off-by: Martin Schwenke <mar...@meltin.net> ----------------------------------------------------------------------- Summary of changes: Makefile.in | 10 ++-- config/events.d/11.natgw | 2 +- config/events.d/60.ganesha | 16 +------ config/events.d/60.nfs | 18 +------ config/functions | 43 ++++++++++++++++ configure.ac | 20 +------- packaging/RPM/ctdb.spec.in | 27 ++++++++++ packaging/RPM/makerpms.sh | 2 +- server/ctdb_takeover.c | 107 ++++++++++++++++++++++++++++++++++++++-- tests/scripts/integration.bash | 15 +++-- tests/scripts/run_tests | 22 +++++++- utils/pmda/config.m4 | 32 ++++++++++++ 12 files changed, 245 insertions(+), 69 deletions(-) create mode 100644 utils/pmda/config.m4 Changeset truncated at 500 lines: diff --git a/Makefile.in b/Makefile.in index 1bbec6f..6b86bad 100755 --- a/Makefile.in +++ b/Makefile.in @@ -46,7 +46,7 @@ SOCKET_WRAPPER_OBJ = @SOCKET_WRAPPER_OBJS@ PMDA_LIBS = -lpcp -lpcp_pmda PMDA_INSTALL = @CTDB_PMDA_INSTALL@ -PMDA_DEST_DIR = /var/lib/pcp/pmdas +PMDA_DEST_DIR = /var/lib/pcp/pmdas/ctdb CFLAGS=@CPPFLAGS@ -g -I$(srcdir)/include -Iinclude -Ilib -Ilib/util -I$(srcdir) \ $(TALLOC_CFLAGS) $(TEVENT_CFLAGS) $(TDB_CFLAGS) -I@libreplacedir@ \ @@ -389,10 +389,10 @@ install: all manpages $(PMDA_INSTALL) if [ ! -f $(DESTDIR)$(etcdir)/ctdb/gcore_trace.sh ];then ${INSTALLCMD} -m 755 config/gcore_trace.sh $(DESTDIR)$(etcdir)/ctdb; fi install_pmda: - $(INSTALLCMD) -m 755 -d $(PMDA_DEST_DIR) - $(INSTALLCMD) -m 755 pmda/Install pmda/Remove $(PMDA_DEST_DIR) - $(INSTALLCMD) -m 644 pmda/pmns pmda/domain.h pmda/help pmda/README $(PMDA_DEST_DIR) - $(INSTALLCMD) -m 755 bin/pmdactdb $(PMDA_DEST_DIR) + $(INSTALLCMD) -m 755 -d $(DESTDIR)$(PMDA_DEST_DIR) + $(INSTALLCMD) -m 755 utils/pmda/Install utils/pmda/Remove $(DESTDIR)$(PMDA_DEST_DIR) + $(INSTALLCMD) -m 644 utils/pmda/pmns utils/pmda/domain.h utils/pmda/help utils/pmda/README $(DESTDIR)$(PMDA_DEST_DIR) + $(INSTALLCMD) -m 755 bin/pmdactdb $(DESTDIR)$(PMDA_DEST_DIR) # Should use $(datarootdir) but older autoconfs don't do this. :-( install_tests: all diff --git a/config/events.d/11.natgw b/config/events.d/11.natgw index c6c45ca..9faba80 100755 --- a/config/events.d/11.natgw +++ b/config/events.d/11.natgw @@ -28,7 +28,7 @@ delete_all() { _maskbits="${CTDB_NATGW_PUBLIC_IP#*/}" [ -z "$CTDB_NATGW_PUBLIC_IFACE" ] || { - delete_ip_from_iface $CTDB_NATGW_PUBLIC_IFACE $_ip $_maskbits 2>/dev/null + delete_ip_from_iface $CTDB_NATGW_PUBLIC_IFACE $_ip $_maskbits >/dev/null 2>&1 } ip route del 0.0.0.0/0 metric 10 >/dev/null 2>/dev/null diff --git a/config/events.d/60.ganesha b/config/events.d/60.ganesha index 80e5ae7..0066c54 100755 --- a/config/events.d/60.ganesha +++ b/config/events.d/60.ganesha @@ -44,14 +44,6 @@ service_name="nfs-ganesha-$CTDB_CLUSTER_FILESYSTEM_TYPE" ctdb_setup_service_state_dir -statd_update_trigger="$service_state_dir/update-trigger" -# We want this file to always exist. The corner case is when -# auto-start/stop is switched off, NFS is added as a managed service -# some time after ctdbd is started and someone else starts the NFS -# service for us. In this case this file might not otherwise exist -# when we get to a monitor event. -touch "$statd_update_trigger" - ctdb_start_stop_service is_ctdb_managed_service || exit 0 @@ -216,13 +208,7 @@ case "$1" in # once every 60 seconds, update the statd state database for which # clients need notifications - LAST_UPDATE=`stat --printf="%Y" "$statd_update_trigger" 2>/dev/null` - CURRENT_TIME=`date +"%s"` - [ $CURRENT_TIME -ge $(($LAST_UPDATE + 60)) ] && { - touch "$statd_update_trigger" - $CTDB_BASE/statd-callout updatelocal & - $CTDB_BASE/statd-callout updateremote & - } + nfs_statd_update 60 ;; *) diff --git a/config/events.d/60.nfs b/config/events.d/60.nfs index 46456bc..eb98ee1 100755 --- a/config/events.d/60.nfs +++ b/config/events.d/60.nfs @@ -32,14 +32,6 @@ loadconfig ctdb_setup_service_state_dir -statd_update_trigger="$service_state_dir/update-trigger" -# We want this file to always exist. The corner case is when -# auto-start/stop is switched off, NFS is added as a managed service -# some time after ctdbd is started and someone else starts the NFS -# service for us. In this case this file might not otherwise exist -# when we get to a monitor event. -touch "$statd_update_trigger" - ctdb_start_stop_service is_ctdb_managed_service || exit 0 @@ -79,15 +71,9 @@ case "$1" in nfs_check_rpc_services - # once every 600 seconds, update the statd state database for which + # Every 10 minutes, update the statd state database for which # clients need notifications - LAST_UPDATE=`stat --printf="%Y" "$statd_update_trigger"` - CURRENT_TIME=`date +"%s"` - [ $CURRENT_TIME -ge $(($LAST_UPDATE + 600)) ] && { - touch "$statd_update_trigger" - $CTDB_BASE/statd-callout updatelocal & - $CTDB_BASE/statd-callout updateremote & - } + nfs_statd_update 600 ;; *) diff --git a/config/functions b/config/functions index 5778420..f4707a7 100755 --- a/config/functions +++ b/config/functions @@ -860,6 +860,23 @@ startstop_nfslock() { esac } +# Periodically update the statd database +nfs_statd_update () +{ + _update_period="$1" + + _statd_update_trigger="$service_state_dir/update-trigger" + [ -f "$_statd_update_trigger" ] || touch "$_statd_update_trigger" + + _last_update=$(stat --printf="%Y" "$_statd_update_trigger") + _current_time=$(date +"%s") + if [ $(( $_current_time - $_last_update)) -ge $_update_period ] ; then + touch "$_statd_update_trigger" + $CTDB_BASE/statd-callout updatelocal & + $CTDB_BASE/statd-callout updateremote & + fi +} + add_ip_to_iface() { _iface=$1 @@ -1425,6 +1442,32 @@ iptables() flock -w 30 $CTDB_VARDIR/iptables-ctdb.flock /sbin/iptables "$@" } +# AIX (and perhaps others?) doesn't have mktemp +if ! which mktemp >/dev/null 2>&1 ; then + mktemp () + { + _dir=false + if [ "$1" = "-d" ] ; then + _dir=true + shift + fi + _d="${TMPDIR:-/tmp}" + _hex10=$(dd if=/dev/urandom count=20 2>/dev/null | \ + md5sum | \ + sed -e 's@\(..........\).*@\1@') + _t="${_d}/tmp.${_hex10}" + ( + umask 077 + if $_dir ; then + mkdir "$_t" + else + >"$_t" + fi + ) + echo "$_t" + } +fi + ######################################################## # tickle handling ######################################################## diff --git a/configure.ac b/configure.ac index 85934a7..37b5a64 100644 --- a/configure.ac +++ b/configure.ac @@ -94,16 +94,9 @@ m4_include(ib/config.m4) m4_include(lib/util/signal.m4) m4_include(lib/util/fault.m4) m4_include(lib/socket_wrapper/config.m4) +m4_include(utils/pmda/config.m4) AC_CHECK_HEADERS(sched.h) -AC_CHECK_HEADERS(pcp/pmapi.h pcp/impl.h pcp/pmda.h, [], [], -[[#ifdef HAVE_PCP_PMAPI_H -# include <pcp/pmapi.h> -#endif -#ifdef HAVE_PCP_IMPL_H -# include <pcp/impl.h> -#endif -]]) AC_CHECK_DECL([ETIME], [],[AC_DEFINE([ETIME], ETIMEDOUT, [ETIME on non-supporting platforms])], [ #include <errno.h> @@ -122,20 +115,9 @@ if test x"$ctdb_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property]) fi -if test x"$ac_cv_header_pcp_pmda_h" = x"yes"; then - CTDB_PMDA=bin/pmdactdb - CTDB_PMDA_INSTALL=install_pmda -else - CTDB_PMDA= - CTDB_PMDA_INSTALL= -fi - - AC_SUBST(EXTRA_OBJ) AC_SUBST(CTDB_SYSTEM_OBJ) AC_SUBST(CTDB_SCSI_IO) AC_SUBST(CTDB_PCAP_LDFLAGS) -AC_SUBST(CTDB_PMDA) -AC_SUBST(CTDB_PMDA_INSTALL) AC_OUTPUT(Makefile ctdb.pc) diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in index 9872427..44bd46f 100644 --- a/packaging/RPM/ctdb.spec.in +++ b/packaging/RPM/ctdb.spec.in @@ -45,6 +45,12 @@ BuildRequires: libtdb-devel >= %{libtdb_version} BuildRequires: libtevent-devel >= %{libtevent_version} %endif +# To build the ctdb-pcp-pmda package, run rpmbuild with "--with pmda" +%define with_pcp_pmda %{?_with_pmda: 1} %{?!_with_pmda: 0} +%if %with_pcp_pmda +BuildRequires: pcp-libs-devel +%endif + %description ctdb is the clustered database used by samba @@ -81,6 +87,9 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE" ./configure \ %if %with_included_tevent --with-included-tevent \ %endif +%if %with_pcp_pmda + --enable-pmda \ +%endif --prefix=%{_prefix} \ --sysconfdir=%{_sysconfdir} \ --mandir=%{_mandir} \ @@ -216,6 +225,24 @@ test suite for ctdb %{_bindir}/ctdb_run_cluster_tests %doc tests/README +%if %with_pcp_pmda + +%package pcp-pmda +Summary: CTDB PCP pmda support +Group: Development/Tools +Requires: ctdb = %{version} +Requires: pcp-libs + +%description pcp-pmda +Performance Co-Pilot (PCP) support for CTDB + +%files pcp-pmda +%dir /var/lib/pcp/pmdas/ctdb +/var/lib/pcp/pmdas/ctdb/* + +%endif + + %changelog * Thu Mar 1 2012 : Version 1.13 diff --git a/packaging/RPM/makerpms.sh b/packaging/RPM/makerpms.sh index d3bda52..8dbec55 100755 --- a/packaging/RPM/makerpms.sh +++ b/packaging/RPM/makerpms.sh @@ -32,7 +32,7 @@ # /usr/src/redhat directory # -EXTRA_OPTIONS="$1" +EXTRA_OPTIONS="$*" DIRNAME=$(dirname $0) TOPDIR=${DIRNAME}/../.. diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c index b5e7f87..fda7c56 100644 --- a/server/ctdb_takeover.c +++ b/server/ctdb_takeover.c @@ -2541,13 +2541,70 @@ static struct ctdb_ipflags *set_ipflags(struct ctdb_context *ctdb, return ipflags; } +struct iprealloc_callback_data { + bool *retry_nodes; + int retry_count; + client_async_callback fail_callback; + void *fail_callback_data; + struct ctdb_node_map *nodemap; +}; + +static void iprealloc_fail_callback(struct ctdb_context *ctdb, uint32_t pnn, + int32_t res, TDB_DATA outdata, + void *callback) +{ + int numnodes; + struct iprealloc_callback_data *cd = + (struct iprealloc_callback_data *)callback; + + switch (res) { + case -ETIME: + /* If the control timed out then that's a real error, + * so call the real fail callback + */ + cd->fail_callback(ctdb, pnn, res, outdata, + cd->fail_callback_data); + break; + default: + /* If not a timeout then either the ipreallocated + * eventscript (or some setup) failed. This might + * have failed because the IPREALLOCATED control isn't + * implemented - right now there is no way of knowing + * because the error codes are all folded down to -1. + * Consider retrying using EVENTSCRIPT control... + */ + + numnodes = talloc_array_length(cd->retry_nodes); + if (pnn > numnodes) { + DEBUG(DEBUG_ERR, + ("ipreallocated failure from node %d, but only %d nodes in nodemap\n", + pnn, numnodes)); + return; + } + + /* Can't run the "ipreallocated" event on a STOPPED node */ + if (cd->nodemap->nodes[pnn].flags & NODE_FLAGS_STOPPED) { + DEBUG(DEBUG_ERR, + ("ipreallocated failure from node %d, but node is stopped - not flagging a retry\n", + pnn)); + return; + } + + DEBUG(DEBUG_WARNING, + ("ipreallocated failure from node %d, flagging retry\n", + pnn)); + cd->retry_nodes[pnn] = true; + cd->retry_count++; + } +} + /* make any IP alias changes for public addresses that are necessary */ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap, client_async_callback fail_callback, void *callback_data) { - int i; + int i, j; struct ctdb_public_ip ip; struct ctdb_public_ipv4 ipv4; uint32_t *nodes; @@ -2559,6 +2616,8 @@ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap, TALLOC_CTX *tmp_ctx = talloc_new(ctdb); uint32_t disable_timeout; struct ctdb_ipflags *ipflags; + struct iprealloc_callback_data iprealloc_data; + bool *retry_data; /* * ip failover is completely disabled, just send out the @@ -2718,13 +2777,53 @@ ipreallocated: * IPs have moved. Once upon a time this event only used to * update natwg. */ + retry_data = talloc_zero_array(tmp_ctx, bool, nodemap->num); + CTDB_NO_MEMORY_FATAL(ctdb, retry_data); + iprealloc_data.retry_nodes = retry_data; + iprealloc_data.retry_count = 0; + iprealloc_data.fail_callback = fail_callback; + iprealloc_data.fail_callback_data = callback_data; + iprealloc_data.nodemap = nodemap; + nodes = list_of_connected_nodes(ctdb, nodemap, tmp_ctx, true); if (ctdb_client_async_control(ctdb, CTDB_CONTROL_IPREALLOCATED, nodes, 0, TAKEOVER_TIMEOUT(), false, tdb_null, - NULL, fail_callback, - callback_data) != 0) { - DEBUG(DEBUG_ERR, (__location__ " failed to send control to run eventscripts with \"ipreallocated\"\n")); + NULL, iprealloc_fail_callback, + &iprealloc_data) != 0) { + + /* If the control failed then we should retry to any + * nodes flagged by iprealloc_fail_callback using the + * EVENTSCRIPT control. This is a best-effort at + * backward compatiblity when running a mixed cluster + * where some nodes have not yet been upgraded to + * support the IPREALLOCATED control. + */ + DEBUG(DEBUG_WARNING, + ("Retry ipreallocated to some nodes using eventscript control\n")); + + nodes = talloc_array(tmp_ctx, uint32_t, + iprealloc_data.retry_count); + CTDB_NO_MEMORY_FATAL(ctdb, nodes); + + j = 0; + for (i=0; i<nodemap->num; i++) { + if (iprealloc_data.retry_nodes[i]) { + nodes[j] = i; + j++; + } + } + + data.dptr = discard_const("ipreallocated"); + data.dsize = strlen((char *)data.dptr) + 1; + if (ctdb_client_async_control(ctdb, + CTDB_CONTROL_RUN_EVENTSCRIPTS, + nodes, 0, TAKEOVER_TIMEOUT(), + false, data, + NULL, fail_callback, + callback_data) != 0) { + DEBUG(DEBUG_ERR, (__location__ " failed to send control to run eventscripts with \"ipreallocated\"\n")); + } } talloc_free(tmp_ctx); diff --git a/tests/scripts/integration.bash b/tests/scripts/integration.bash index 429df69..45e0b99 100644 --- a/tests/scripts/integration.bash +++ b/tests/scripts/integration.bash @@ -574,8 +574,8 @@ daemons_setup () echo 127.0.0.$i >>"$CTDB_NODES" # 2 public addresses on most nodes, just to make things interesting. if [ $(($i - 1)) -ne $no_public_ips ] ; then - echo "192.0.2.$i/24 lo" >>"$public_addresses_all" - echo "192.0.2.$(($i + $TEST_LOCAL_DAEMONS))/24 lo" >>"$public_addresses_all" + echo "192.168.234.$i/24 lo" >>"$public_addresses_all" + echo "192.168.234.$(($i + $TEST_LOCAL_DAEMONS))/24 lo" >>"$public_addresses_all" fi fi done @@ -740,8 +740,6 @@ restart_ctdb () continue } - local debug_out=$(onnode -p all ctdb status -Y 2>&1; onnode -p all ctdb scriptstatus 2>&1) - echo "Setting RerecoveryTimeout to 1" onnode -pq all "$CTDB setvar RerecoveryTimeout 1" @@ -756,7 +754,10 @@ restart_ctdb () # Cluster is still healthy. Good, we're done! if ! onnode 0 $CTDB_TEST_WRAPPER _cluster_is_healthy ; then - echo "Cluster become UNHEALTHY again. Restarting..." + echo "Cluster became UNHEALTHY again [$(date)]" + onnode -p all ctdb status -Y 2>&1 + onnode -p all ctdb scriptstatus 2>&1 + echo "Restarting..." continue fi @@ -768,7 +769,9 @@ restart_ctdb () done echo "Cluster UNHEALTHY... too many attempts..." - echo "$debug_out" + onnode -p all ctdb status -Y 2>&1 + onnode -p all ctdb scriptstatus 2>&1 + # Try to make the calling test fail status=1 return 1 diff --git a/tests/scripts/run_tests b/tests/scripts/run_tests index 35db196..a3af5cb 100755 --- a/tests/scripts/run_tests +++ b/tests/scripts/run_tests @@ -140,8 +140,26 @@ tests_passed=0 tests_failed=0 summary="" -rows=$(if tty -s ; then stty size ; else echo x 80 ; fi | sed -e 's@.* @@' -e 's@^0$@80@') -ww=$((rows - 7)) +if ! which mktemp >/dev/null 2>&1 ; then + # Not perfect, but it will do... + mktemp () + { + _dir=false + if [ "$1" = "-d" ] ; then + _dir=true + fi + _t="${TMPDIR:-/tmp}/tmp.$$.$RANDOM" + ( + umask 077 + if $_dir ; then + mkdir "$_t" + else + >"$_t" + fi + ) + echo "$_t" + } +fi -- CTDB repository