Martin Schwenke [Thu, 13 Jan 2011 22:40:11 +0000 (09:40 +1100)]
Eventscripts: change failure counts and behaviour for statd and nfsd.
We reduce the number of failures before attempting a restart.
However, after 6 failures we mark the cluster unhealthy and no longer
try to restart. If the previous 2 attempts didn't work then there
isn't any use in bogging the system down with an attempted restart on
every monitor event.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Fri, 17 Dec 2010 05:25:04 +0000 (16:25 +1100)]
Eventscripts: clean up 60.nfs monitor event.
This adds a helper function called nfs_check_rpc_service() and uses it
to make the monitor event much more readable. An example of usage is
as follows:
nfs_check_rpc_service "mountd" \
-ge 10 "verbose restart:b unhealthy" \
-eq 5 "restart:b"
The first argument to nfs_check_rpc_service() is the name of the RPC
service to be checked. The RPC service corresponding to this command
is checked for availability using the rpcinfo command. If the service
is available then the function succeeds and subsequent arguments are
ignored.
If the rpcinfo check fails then a failure counter for that particular
RPC service is incremented and subsequent arguments are processed in
groups of 3:
1. An integer comparison operator supported by test.
2. An integer failure limit.
3. An action string.
The value of the failure counter is checked using (1) and (2) above.
The first check that succeeds has its action string processed - note
that this explains the somewhat curious reverse ordering of checks.
It the example above:
* If the counter is >= 10 then a verbose message is printed
describing the failure, the service is restarted in the background
and the node is marked as unhealthy (via an "exit 1" from the
function).
* If the counter is == 5 then the service us restarted in the
background.
For more action options please see the code.
This also changes the ctdb_check_rpc() function so that it no longer
takes a program number to check. It now just takes a real RPC program
name that rpcinfo can resolve via /etc/rpc.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Ronnie Sahlberg [Thu, 11 Aug 2011 04:15:22 +0000 (14:15 +1000)]
Merge remote branch 'martins/eventscript.10.interface'
Ronnie Sahlberg [Thu, 11 Aug 2011 04:01:02 +0000 (14:01 +1000)]
Merge remote branch 'martins/eventscript_infrastructure'
Martin Schwenke [Mon, 23 May 2011 06:00:05 +0000 (16:00 +1000)]
Eventscripts: in 60.nfs move statd-notify code to service_reconfigure().
This means that it now occurs on every reconfigure event. As a result
the ipreallocated event is removed.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 11 Aug 2011 03:55:02 +0000 (13:55 +1000)]
Eventscripts - 60.nfs should define service_reconfigure().
Not $service_reconfigure.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Ronnie Sahlberg [Thu, 11 Aug 2011 01:45:59 +0000 (11:45 +1000)]
When starting and stopping ctdb through the init-script, make sure we first clear all public ips bvefore we start the daemon, in case they are still hanging around since a previous kill -9 and also make sure we drop them after we have stopped the deamon when shutting down
CQ S1027550
Martin Schwenke [Thu, 13 Jan 2011 22:31:56 +0000 (09:31 +1100)]
Evenscripts: improvements to ctdb_service_check_reconfigure().
* Make this function applicable to "ipreallocated" event too.
* Monitor event should not always succeed just because we reconfigure.
If the service was unhealthy before the reconfigure and we end the
reconfigure with "exit 0" then we can cause the node's health status
to flip-flop.
To avoid this we return the status of the service from the previous
monitor event.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Fri, 27 May 2011 04:37:37 +0000 (14:37 +1000)]
Eventscripts: 50.samba - only start/stop nmbd if $CTDB_SERVICE_NMB set.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Mon, 23 May 2011 05:37:09 +0000 (15:37 +1000)]
Eventscripts: 50.samba needs null service_reconfigure() function.
Samba doesn't need to do anything for configuration changes. It will
notice configuration changes and reload automatically.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 13 Jan 2011 22:42:18 +0000 (09:42 +1100)]
Eventscripts: 40.vsftpd service_stop() no longer /dev/null's output.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 13 Jan 2011 22:43:01 +0000 (09:43 +1100)]
Eventscripts: improvements to 41.httpd.
* Reduce the failure counts so that restart attempts happen sooner.
* Use service_start() and service_stop() for the restart.
ctdb_service_start() resets the failure count, which isn't very
useful in this context.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Fri, 17 Dec 2010 05:10:56 +0000 (16:10 +1100)]
Eventscript functions: new function ctdb_check_counter().
This should eventually be able to replace ctdb_check_counter_limit()
and ctdb_check_counter_equal(), although it doesn't issue warnings
like the former.
It takes 4 optional arguments:
1. _msg - If "error" then over limit causes an error message and and
exit 1. Anything else fails silently but the function returns 1.
Default is "error".
2. _op - An integer operator supported by test (e.g. -eq, -ge, -gt).
Default is -ge.
3. _limit - Limit for the counter to be used in comparison. Default is
$service_fail_limit.
4. _service_name - Used to identify the counter. Default is
$service_name.
For example:
ctdb_check_counter error -ge 5 foo
will print a message and exit 1 if the counter for foo is >= 5,
whereas
ctdb_check_counter check -ge 5 foo
will just return 1 if the counter for foo is >= 5, and
ctdb_counter_check
with print a message and exit 1 if the counter for $service_name is >=
$service_fail_limit.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 04:57:11 +0000 (14:57 +1000)]
Eventscripts: remove unused remove_ip() function.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 13 Jan 2011 22:31:05 +0000 (09:31 +1100)]
Eventscripts: startstop_nfs stop no longer redirects output to /dev/null.
When stopping (as opposed to restarting) it is useful to see this
information.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 13 Jan 2011 22:29:16 +0000 (09:29 +1100)]
Eventscripts: fix typo in _ctdb_counter_common().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 13 Jan 2011 22:30:21 +0000 (09:30 +1100)]
Eventscripts: improve log messages in ctdb_start_stop_service().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 15 Dec 2010 23:11:33 +0000 (10:11 +1100)]
Eventscript functions: fix counter regression.
d362be7d32079ac1390d67056ce107bfbca2c937 wasn't well thought out.
Subsequent commits depend on ctdb_counter_init() taking an argument,
so this makes those cases work.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 15 Dec 2010 22:50:44 +0000 (09:50 +1100)]
Eventscript functions: ctdb_service_check-reconfigure() acts only on monitor.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Fri, 17 Dec 2010 05:29:21 +0000 (16:29 +1100)]
Eventscripts: make 50.samba use $service_state_dir.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 15 Dec 2010 22:45:28 +0000 (09:45 +1100)]
Evenscripts: update 60.nfs to use ctdb_service_check_reconfigure.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 15 Dec 2010 21:57:46 +0000 (08:57 +1100)]
Evenscripts: update 60.nfs to use ctdb_setup_service_state_dir.
The state directory basename becomes "nfs" rather than "statd". One
line of code i moved from the "startup" event to service_start().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 15 Dec 2010 22:48:25 +0000 (09:48 +1100)]
Evenscripts: update 40.vsftpd to use ctdb_service_check_reconfigure.
To simplify we also remove the reconfigure from the recovered event
because the monitor event will handle this very quickly anyway.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 15 Dec 2010 22:47:10 +0000 (09:47 +1100)]
Evenscripts: update 41.httpd to use ctdb_service_check_reconfigure.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 15 Dec 2010 08:19:21 +0000 (19:19 +1100)]
Eventscripts: rejig the reconfigure infrastructure.
* Add an optional service name argument to existing reconfigure
functions.
* User function service_reconfigure() instead of variable
$service_reconfigure to specify how a service is reconfigured.
* New function ctdb_service_check_reconfigure() reconfigures a service
if it is flagged for reconfigure.
* Remove $service_reconfigure settings from 40.vsftpd and 41.httpd -
they're the defaults.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 15 Dec 2010 05:34:00 +0000 (16:34 +1100)]
Eventscript functions: move flagging of managed services.
Move flagging of managed or unmanaged services into
ctdb_service_start() and ctdb_service_stop(). That way services will
be correctly flagged if they are started from the startup and shutdown
events.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 10 Aug 2011 23:39:25 +0000 (09:39 +1000)]
Eventscript function: change service_start into a function.
service_start is currently a variable. This makes passing arguments
hard. We change it to be a function and put default definitions into
the functions file.
We use a convention that if a service name argument is passed to a
redefined version of service_start() or service_stop() then it will
act unconditionally. If no argument is passed then it can use
internal logic to decide if services should really be started. This
is useful when a single eventscript handles multiple services.
This is a cherry-pick of
ae38895 that needed to be reset mid-stream.
There is still some breakage following this commit.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 14 Dec 2010 23:48:00 +0000 (10:48 +1100)]
Eventscript functions: add optional event name argument to fail count functions.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 18 Nov 2010 05:19:45 +0000 (16:19 +1100)]
Eventscript functions - optimise is_ctdb_managed_service().
This function generates a lot of trace when running under "set -x".
This is due to the backward compatibility code.
This adds 3 optimisations:
1. Before invoking the backward compatiblity code,
is_ctdb_managed_service() returns early if the service is listed in
$CTDB_MANAGED_SERVICES.
2. ctdb_compat_managed_service() actually now updates
$CTDB_MANAGED_SERVICES instead of temporary variable $t.
This means that a subsequent call to is_ctdb_managed_service() will
short circuit due to optimisation (1).
3. ctdb_compat_managed_service() only adds a service to
$CTDB_MANAGED_SERVICES if it is the service being checked by
is_ctdb_managed_service().
This stops irrelevant services being added to
$CTDB_MANAGED_SERVICES multiple times by multiple calls to
is_ctdb_managed_service().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 18 Nov 2010 05:03:47 +0000 (16:03 +1100)]
50.samba eventscript should use is_ctdb_managed_service "winbind".
Currently it checks $CTDB_MANAGES_WINBIND directly in several places.
This doesn't work when someone sets $CTDB_MANAGED_SERVICES directly.
This modifies check_ctdb_manages_winbind() so that it return a
condition rather than modifying $CTDB_MANAGES_WINBIND. This makes
some code more readable.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 18 Nov 2010 03:34:48 +0000 (14:34 +1100)]
50.samba eventscript should use is_ctdb_managed_service "samba".
Currently it checks $CTDB_MANAGES_SAMBA directly. This doesn't work
when someone sets $CTDB_MANAGED_SERVICES directly.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 18 Nov 2010 00:04:52 +0000 (11:04 +1100)]
50.samba eventscript should stop/start services when they become (un)managed.
When the value of $CTDB_MANAGES_SAMBA or $CTDB_MANAGES_WINBIND (or
corresponding changes are made to $CTDB_MANAGED_VERSIONS), the
associated service should be started or stopped as necessary.
This add calls to ctdb_start_stop_service() to manage
starting/stopping samba and winbind.
An associated cleanup is made to the initial checks that one of
$CTDB_MANAGES_SAMBA or $CTDB_MANAGES_WINBIND is set, replacing them
with calls to is_ctdb_managed_service().
To handle the winbind cases ctdb_start_stop_service() and
is_ctdb_managed_service() are updated to take an optional service name
parameter.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Conflicts:
config/events.d/50.samba
Most of this merged elsewhere. This just removes a check that
this is the monitor event.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Ronnie Sahlberg [Thu, 11 Aug 2011 00:07:50 +0000 (10:07 +1000)]
Add documentation for the new filesystem use monitoring
Ronnie Sahlberg [Thu, 11 Aug 2011 00:00:53 +0000 (10:00 +1000)]
Add new eventscript 40.fs_use that can be used to monitor file system use and flag a node unhealthy when they become full
Ronnie Sahlberg [Wed, 10 Aug 2011 23:11:38 +0000 (09:11 +1000)]
make the persistent even longer for lvs to make people even happier
Ronnie Sahlberg [Wed, 10 Aug 2011 21:14:57 +0000 (07:14 +1000)]
increase the persistent timeout to make people happier
Ronnie Sahlberg [Wed, 10 Aug 2011 21:13:28 +0000 (07:13 +1000)]
check the shares if they are available before we decide to try to restart nfs
CQ S1027529
Martin Schwenke [Wed, 10 Aug 2011 06:06:26 +0000 (16:06 +1000)]
Eventscripts - fix 10.interface bash incompatibility.
In dash, this fails gracefully with nothing to stderr:
t=$(cat /does_not_exist) 2>/dev/null
In bash the error from cat is still printed due to different order of
evaluation.
This works everywhere:
t=$(cat /does_not_exist 2>/dev/null)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Ronnie Sahlberg [Wed, 10 Aug 2011 05:36:20 +0000 (15:36 +1000)]
Merge remote branch 'martins/eventscript.00.ctdb'
Martin Schwenke [Wed, 10 Aug 2011 05:32:58 +0000 (15:32 +1000)]
Merge branch 'eventscript.20.multipathd' into eventscript.00.ctdb
Ronnie Sahlberg [Wed, 10 Aug 2011 05:32:24 +0000 (15:32 +1000)]
Merge remote branch 'martins/eventscript.20.multipathd'
Martin Schwenke [Wed, 10 Aug 2011 05:32:11 +0000 (15:32 +1000)]
Merge branch 'eventscript.62.cnfs' into eventscript.20.multipathd
Ronnie Sahlberg [Wed, 10 Aug 2011 05:31:56 +0000 (15:31 +1000)]
Merge remote branch 'martins/eventscript.62.cnfs'
Martin Schwenke [Wed, 10 Aug 2011 05:31:13 +0000 (15:31 +1000)]
Merge branch 'eventscript.13.per_ip_routing' into eventscript.62.cnfs
Ronnie Sahlberg [Wed, 10 Aug 2011 05:22:46 +0000 (15:22 +1000)]
Merge remote branch 'martins/eventscript.13.per_ip_routing'
Ronnie Sahlberg [Wed, 10 Aug 2011 05:18:16 +0000 (15:18 +1000)]
Merge remote branch 'martins/eventscript_tests'
Ronnie Sahlberg [Wed, 10 Aug 2011 05:15:12 +0000 (15:15 +1000)]
Merge remote branch 'martins/eventscripts_relative'
Ronnie Sahlberg [Wed, 10 Aug 2011 05:11:00 +0000 (15:11 +1000)]
Merge remote branch 'martins/test_suite'
Martin Schwenke [Wed, 15 Dec 2010 21:48:21 +0000 (08:48 +1100)]
Evenscripts: update 61.cnfs to use ctdb_setup_service_state_dir.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 15 Dec 2010 21:42:44 +0000 (08:42 +1100)]
Evenscripts: update 13.per_ip_routing to use ctdb_setup_service_state_dir.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 15 Dec 2010 21:45:28 +0000 (08:45 +1100)]
Evenscripts: update 20.multipathd to use ctdb_setup_service_state_dir.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Fri, 17 Dec 2010 05:23:31 +0000 (16:23 +1100)]
Eventscripts: fix dangerous rm -rf in 00.ctdb init event.
Also remove some unnecessary absolute paths for commands, which were
making the code slightly difficult to read.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Fri, 17 Dec 2010 05:21:53 +0000 (16:21 +1100)]
Eventscripts: 00.ctdb uses $service_state_dir, neaten update_config_from_tdb().
This also fixes a bug where update_config_from_tdb() used an incorrect
filename in one place.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Fri, 19 Nov 2010 03:32:28 +0000 (14:32 +1100)]
00.ctdb eventscript removes all files from $ctdb_active_dir.
Without this you can get into a situation where ctdbd can not start.
If the active file for a service exists but the service is not
running, then trying to stop the service may fail, causing the
eventscript to exit from ctdb_start_stop_service().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 07:29:49 +0000 (17:29 +1000)]
Scripts: add note about not using absolute command paths to README.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 05:19:34 +0000 (15:19 +1000)]
Add a README to the config/ subdirectory.
This includes a comment about using POSIX Bourne shell, including a
suggestion not to use "local" variables.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 14 Dec 2010 23:49:48 +0000 (10:49 +1100)]
Eventscript functions: new function ctdb_setup_service_state_dir().
To be used by eventscripts to create a per-service directory for their
own state data. $service_state_dir is set to point to the new
directory.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 14 Dec 2010 23:45:17 +0000 (10:45 +1100)]
Eventscript functions: new functions to remember/check if service managed.
This was done ad hoc and was badly named.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 9 Aug 2011 03:12:08 +0000 (13:12 +1000)]
Merge branch 'test_suite' into ronnie_target
Martin Schwenke [Tue, 9 Aug 2011 03:11:38 +0000 (13:11 +1000)]
Merge branch 'eventscript_tests' into ronnie_target
Martin Schwenke [Tue, 12 Oct 2010 05:49:42 +0000 (16:49 +1100)]
Test suite: print debug output after cluster (un)healthy flip-flop on restart.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Fri, 11 Feb 2011 04:13:37 +0000 (15:13 +1100)]
Allow proxy_node to be specified for wait_until_node_has_status().
Default to "any"... but allow specification because sometimes it
matters...
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Fri, 11 Feb 2011 04:14:46 +0000 (15:14 +1100)]
Test suite: Fix consistency in 26_ctdb_config_check_error_on_unreachable.
The test currently waits until any node thinks that the test node is
disconnected, and then uses node 0 as a proxy for testing. However,
nodes may notice at different times that a node is disconnected, so
this test can fail unnecessarily.
We force the proxy node for the wait-until-disconnected to be the same
as the proxy node used to launch the actual tests.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 16 Feb 2011 20:03:19 +0000 (07:03 +1100)]
Test suite: Fix consistency in 09_ctdb_ping.sh.
Same problem as described in commit
283a85b42d9c0a26acb64d5abcc7f175e31e6e75.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 13 Apr 2011 06:22:02 +0000 (16:22 +1000)]
Test suite: Strip architecture suffix from CTDB RPM package version.
Later versions of RPM seem to include it but we don't want it.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 11 May 2011 05:14:16 +0000 (15:14 +1000)]
Test suite: remove getmonmode test.
This can't be made 100% reliable since the monitor mode can change
underneath us due to some event. Therefore, the test is useless.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Conflicts:
tests/simple/20_ctdb_getmonmode.sh
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 12 Oct 2010 04:10:43 +0000 (15:10 +1100)]
Test suite: Try much harder to get a healthy cluster when it is restarted.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Mon, 8 Aug 2011 06:11:14 +0000 (16:11 +1000)]
Tests - Disable the Samba and NFS eventscript tests.
They're broken and not worth fixing without infrastructure changes so
disable them by taking away the execute bit. This is somewhat easier
than trying to merge in all the other tests but not these ones.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Mon, 8 Aug 2011 05:53:28 +0000 (15:53 +1000)]
Tests - Tweak 10.interfaces 802.ad bonding test to work with current code.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 05:17:37 +0000 (15:17 +1000)]
Scripts: remove absolute paths from interface_modify.sh.
The "ip" command is currently run as "/sbin/ip". This makes it
impossible to replace with a stub in unit testing. The functions file
controls $PATH, so we don't need absolute paths.
This replaces the absolute paths...
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 05:17:37 +0000 (15:17 +1000)]
Scripts: remove absolute paths from interface_modify.sh.
The "ip" command is currently run as "/sbin/ip". This makes it
impossible to replace with a stub in unit testing. The functions file
controls $PATH, so we don't need absolute paths.
This replaces the absolute paths...
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Mon, 8 Aug 2011 05:44:30 +0000 (15:44 +1000)]
Eventscripts - Remove local variable usage in 10.interfaces.
POSIX sh doesn't have local variables. Debian's dash doesn't behave
the same way as bash on this contruct:
local var=`command that produces multiple words`
It only assigns the 1st word and may print an error.
Just remove the use of the "local" keyword in monitor_interfaces() to
solve this. It isn't actually limiting the scope of any variables
that are used outside the function.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Mon, 8 Aug 2011 05:42:45 +0000 (15:42 +1000)]
Tests - implement "ctdb -Y ip -v" in stub for eventscript testing.
This is pretty limited but it gets 10.interfaces tests working.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Mon, 8 Aug 2011 04:45:30 +0000 (14:45 +1000)]
Tests - stub ip program should assume interface name if "dev" not specified.
Currently it fails if you don't use the "dev" keyword.
This makes it behave as expected.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 05:06:10 +0000 (15:06 +1000)]
Eventscripts: source a file specified by $CTDB_RC_LOCAL in functions file.
Another unit testing hook. This is easier than dropping files into
rc.local.d/ and then removing them.
The file has to be executable.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 5 Jul 2011 07:12:21 +0000 (17:12 +1000)]
Tests: update tests to work with previous commit.
Issues:
* 10.monitor no longer prints a message when there is no
public_addresses file.
* Extra bonding test added to check workaround for IEEE 802.3ad
Dynamic link aggregation bonding mode bug.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 7 Jul 2011 06:17:52 +0000 (16:17 +1000)]
Tests: eventscripts and onnode tests use stubs/ subdirectory instead of bin/.
This sets up a more useful convention and avoids future .gitignore
problems.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 5 Jul 2011 02:54:51 +0000 (12:54 +1000)]
Tests: tweak some samba tests to cope with debug from ctdb_check_tcp_ports().
This is a bit too static. However, it can fixed up later if it is a
hassle.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 5 Jul 2011 02:53:20 +0000 (12:53 +1000)]
Tests: Oops! Add bin directory for eventscript tests.
It was matched by .gitignore.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 07:30:45 +0000 (17:30 +1000)]
Git should ignore tests/eventscripts/var.x
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 07:29:13 +0000 (17:29 +1000)]
Tests: initial eventscript unit tests.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Mon, 8 Aug 2011 03:25:40 +0000 (13:25 +1000)]
Merge remote-tracking branch 'origin/master' into eventscripts_relative
Martin Schwenke [Tue, 14 Dec 2010 23:21:39 +0000 (10:21 +1100)]
Eventscript functions - use $CTDB_VARDIR instead of local $ctdb_spool_dir.
Signed-off-by: Martin Schwenke <martin@meltin.net>
David Disseldorp [Sun, 31 Jul 2011 01:14:54 +0000 (03:14 +0200)]
io: Make queue_io_read() safe for reentry
queue_io_read() may be reentered via the queue callback, recoverd is
particularly guilty of this.
queue_io_read() is not safe for reentry if more than one packet is
received and partial chunks follow - data read off the pipe on re-entry
is assumed to be the start-of-packet four byte length. This leads to a
wrongly aligned stream and the notorious "Invalid packet of length 0"
errors.
This change fixes queue_io_read() to be safe under reentry, only a
single packet is processed per call.
https://bugzilla.samba.org/show_bug.cgi?id=8319
Ronnie Sahlberg [Fri, 5 Aug 2011 00:03:34 +0000 (10:03 +1000)]
Remove a log message about setting linkstate for an unknown interface.
sometimes we do want to try to set the linkstate for interfaces that are not in use by public addresses right now (but posisbly by other mechanisms) and these messages just spam the logs
S1026357
Martin Schwenke [Thu, 4 Aug 2011 07:14:11 +0000 (17:14 +1000)]
Eventscripts - remove some more absolute paths to commands.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Ronnie Sahlberg [Thu, 4 Aug 2011 03:49:02 +0000 (13:49 +1000)]
remove log message we dont need
S1026492
Ronnie Sahlberg [Thu, 4 Aug 2011 03:47:52 +0000 (13:47 +1000)]
remove a non-error logmessage about persistent databases being healthy, as expected
S1026492
Ronnie Sahlberg [Thu, 4 Aug 2011 03:46:12 +0000 (13:46 +1000)]
remove a log message we dont need about "allow clients to attach to databases"
S1026492
Ronnie Sahlberg [Thu, 4 Aug 2011 03:44:25 +0000 (13:44 +1000)]
Change the message when we start the daemon to "CTDB starting on node"
S1026492
Martin Schwenke [Wed, 3 Aug 2011 10:12:48 +0000 (20:12 +1000)]
Eventscripts - Rework the use of get_proc() for the bonding checks.
Call call_proc(), put the output into a variable and then use it.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 05:16:32 +0000 (15:16 +1000)]
Eventscripts: update 60.nfs service() start to use set_proc().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 05:36:28 +0000 (15:36 +1000)]
Eventscripts: update 10.interface to use set_proc() and get_proc().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 04:58:13 +0000 (14:58 +1000)]
Eventscripts: use set_proc() in startstop_nfs().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 13 Apr 2011 02:08:09 +0000 (12:08 +1000)]
Eventscripts: remove unnecessary absolute paths from external commands.
For eventscript unit testing it will be necessary to override external
commands to allow stub implementations to be used. If absolute paths
aren't used then this can be done using either a fake bin/
subdirectory or by using shell functions.
This removes all of the simple cases of absolute paths.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Conflicts:
config/ctdb.init
config/events.d/50.samba
Keep old code but remove absolute paths.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Tue, 28 Jun 2011 04:54:33 +0000 (14:54 +1000)]
Eventscripts: new functions set_proc() and get_proc().
These provide a thin layer around writing and reading files in /proc.
They can be easily replaced by stubs for unit testing.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 11 May 2011 05:18:11 +0000 (15:18 +1000)]
Eventscripts: remove ctdb_wait_command() and ctdb_wait_tcp_ports() functions.
These haven't been used for a long time.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Ronnie Sahlberg [Wed, 3 Aug 2011 06:56:26 +0000 (16:56 +1000)]
Merge remote branch 'martins/test_suite'
Martin Schwenke [Tue, 28 Jun 2011 05:04:58 +0000 (15:04 +1000)]
Eventscripts: iptables() should put lock in $CTDB_VARDIR.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Wed, 1 Dec 2010 22:48:02 +0000 (09:48 +1100)]
Make Emacs recognise that the eventscript functions file is a shell script.
Signed-off-by: Martin Schwenke <martin@meltin.net>