summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | Eventscript functions: move flagging of managed services.Martin Schwenke2011-08-111-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 8675744cbd90b5a5095ed6fff7b36ae82004a457)
| | * | Eventscript function: change service_start into a function.Martin Schwenke2011-08-116-50/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 86e4aefed9fd1028660c98e3ea758c2b75ffc1d8)
| | * | Eventscript functions: add optional event name argument to fail count functions.Martin Schwenke2011-08-111-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b14f18649f42aab80ce0336c15ab6159f241c9af)
| | * | Eventscript functions - optimise is_ctdb_managed_service().Martin Schwenke2011-08-111-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 758f4667c60089e09a0439c1eb74f5e426ca5e2e)
| | * | 50.samba eventscript should use is_ctdb_managed_service "winbind".Martin Schwenke2011-08-111-19/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 538902fbc1e74134a03987b36b3733ad641f8971)
| | * | 50.samba eventscript should use is_ctdb_managed_service "samba".Martin Schwenke2011-08-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit d8f0f8948abd340088720718fef7dc858661ba23)
| | * | 50.samba eventscript should stop/start services when they become (un)managed.Martin Schwenke2011-08-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 257a2e350280c0b76ed2fac588cad167381fda52)
| * | | When starting and stopping ctdb through the init-script, make sure we first ↵Ronnie Sahlberg2011-08-111-0/+18
| |/ / | | | | | | | | | | | | | | | | | | | | | 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 (This used to be ctdb commit 8de5513b3ad89711da845c7588d35b32e2f2acb6)
| * | Add documentation for the new filesystem use monitoringRonnie Sahlberg2011-08-111-0/+9
| | | | | | | | | | | | (This used to be ctdb commit 9f10c5d48a08ffb3417f880c801aed2aa2dc1355)
| * | Add new eventscript 40.fs_use that can be used to monitor file system use ↵Ronnie Sahlberg2011-08-113-0/+55
| | | | | | | | | | | | | | | | | | and flag a node unhealthy when they become full (This used to be ctdb commit 2fd1babf8135ad5d53f3b25ba823d840ebc66460)
| * | make the persistent even longer for lvs to make people even happierRonnie Sahlberg2011-08-111-2/+2
| | | | | | | | | | | | (This used to be ctdb commit 8158077624eb763ba40c6a7b4b7faf3867b205d7)
| * | increase the persistent timeout to make people happierRonnie Sahlberg2011-08-111-2/+2
| | | | | | | | | | | | (This used to be ctdb commit 68ea19cb02017e93769df7f6312d5e0bef55e605)
| * | check the shares if they are available before we decide to try to restart nfsRonnie Sahlberg2011-08-111-7/+7
| |/ | | | | | | | | | | CQ S1027529 (This used to be ctdb commit b6c6a4588ccf6ef78fabfd76d228f56b4eb65165)
| * Merge remote branch 'martins/eventscript.00.ctdb'Ronnie Sahlberg2011-08-101-15/+22
| |\ | | | | | | | | | (This used to be ctdb commit 6c287861e780ba985e7ae7a61c1ee462b925e09e)
| | * Merge branch 'eventscript.20.multipathd' into eventscript.00.ctdbMartin Schwenke2011-08-103-18/+11
| | |\ | | | | | | | | | | | | (This used to be ctdb commit 8723b88b0b2bbeece38c74c77c50e8d8b3e2d5ca)
| | * | Eventscripts: fix dangerous rm -rf in 00.ctdb init event.Martin Schwenke2011-08-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 1b3f2dd62efb240f8486016fe0f8dfb73d6ccc66)
| | * | Eventscripts: 00.ctdb uses $service_state_dir, neaten update_config_from_tdb().Martin Schwenke2011-08-091-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit a5ce2adaa39f077f56582072a97bb64d0eba4b4d)
| | * | 00.ctdb eventscript removes all files from $ctdb_active_dir.Martin Schwenke2011-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 28379ca0f747c5952d690a451834ce7421adfd34)
| * | | Merge remote branch 'martins/eventscript.20.multipathd'Ronnie Sahlberg2011-08-101-8/+3
| |\ \ \ | | | |/ | | |/| | | | | (This used to be ctdb commit abe67d6af1e0594641b98facc3534059263e1745)
| | * | Merge branch 'eventscript.62.cnfs' into eventscript.20.multipathdMartin Schwenke2011-08-102-10/+8
| | |\ \ | | | | | | | | | | | | | | | (This used to be ctdb commit fb87fa9273db4f82e801a331b5d95059d64dfb8e)
| | * | | Evenscripts: update 20.multipathd to use ctdb_setup_service_state_dir.Martin Schwenke2011-08-091-8/+3
| | | |/ | | |/| | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 797ca65bdd59b14325ffd32b4d4140e9b01dbe71)
| * | | Merge remote branch 'martins/eventscript.62.cnfs'Ronnie Sahlberg2011-08-101-9/+5
| |\ \ \ | | | |/ | | |/| | | | | (This used to be ctdb commit b8493ceb35b125a390b1e83464fb9ff72f2e1495)
| | * | Merge branch 'eventscript.13.per_ip_routing' into eventscript.62.cnfsMartin Schwenke2011-08-101-1/+3
| | |\ \ | | | | | | | | | | | | | | | (This used to be ctdb commit cfa4102ec0d97e1d1d3c1ce6407ffacdb85c2e10)
| | * | | Evenscripts: update 61.cnfs to use ctdb_setup_service_state_dir.Martin Schwenke2011-08-101-9/+5
| | | |/ | | |/| | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit afafeb1fb12384bddff470d38b534f513a1f3b07)
| * | | Merge remote branch 'martins/eventscript.13.per_ip_routing'Ronnie Sahlberg2011-08-103-9/+87
| |\ \ \ | | | |/ | | |/| | | | | (This used to be ctdb commit 20984a28d9617c0b7a5868057594920ed3f1a2c7)
| | * | Evenscripts: update 13.per_ip_routing to use ctdb_setup_service_state_dir.Martin Schwenke2011-08-091-1/+3
| | |/ | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 18e0236754507a9475653f04bb239c5d46ba51de)
| | * Scripts: add note about not using absolute command paths to README.Martin Schwenke2011-08-091-3/+10
| | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 87e6a4a23a6ae6c276e9628ce513663f47b4ee77)
| | * Add a README to the config/ subdirectory.Martin Schwenke2011-08-091-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 5ae002c7513b1b2aa5136437a1a19f8cd179b869)
| | * Eventscript functions: new function ctdb_setup_service_state_dir().Martin Schwenke2011-08-091-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit a273554791c2a5281aee28f8e2be0c514e14c91e)
| | * Eventscript functions: new functions to remember/check if service managed.Martin Schwenke2011-08-091-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | This was done ad hoc and was badly named. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9a084a121f629b2c1bcefc1e4c4a4a5cacf53987)
| | * Merge branch 'test_suite' into ronnie_targetMartin Schwenke2011-08-095-91/+43
| | |\ | | | | | | | | | | | | (This used to be ctdb commit 414c4d8e901353a3529f82746ffe2e4983a155d6)
| | * \ Merge branch 'eventscript_tests' into ronnie_targetMartin Schwenke2011-08-0982-8/+2425
| | |\ \ | | | | | | | | | | | | | | | (This used to be ctdb commit 432e6c1d5137142ce6b0314a965747524406c17e)
| * | \ \ Merge remote branch 'martins/eventscript_tests'Ronnie Sahlberg2011-08-1082-8/+2425
| |\ \ \ \ | | | |/ / | | |/| | | | | | | (This used to be ctdb commit ac164a0d731fc5d46ab7d05112484c45ecb21100)
| | * | | Tests - Disable the Samba and NFS eventscript tests.Martin Schwenke2011-08-0823-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 151151353e58f59b15be9313e22b7d4f71ee0de8)
| | * | | Tests - Tweak 10.interfaces 802.ad bonding test to work with current code.Martin Schwenke2011-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d3271d316f6d1561e66cbc4cc1b1e8af63895459)
| | * | | Scripts: remove absolute paths from interface_modify.sh.Martin Schwenke2011-08-081-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 5b4c712aab3edc0059f2e5a6730b7fdcf7e5f4ec)
| | * | | Eventscripts - Remove local variable usage in 10.interfaces.Martin Schwenke2011-08-081-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 95d9a1e19655461288a2c7e52abf9d01ab23e05a)
| | * | | Tests - implement "ctdb -Y ip -v" in stub for eventscript testing.Martin Schwenke2011-08-081-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is pretty limited but it gets 10.interfaces tests working. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7130963430e530fa4dd5e6fe132bd7122349cc5f)
| | * | | Tests - stub ip program should assume interface name if "dev" not specified.Martin Schwenke2011-08-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 4fa2073649f25993de4b8ef6b3e7172068a83a29)
| | * | | Eventscripts: source a file specified by $CTDB_RC_LOCAL in functions file.Martin Schwenke2011-08-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit b13ac3bdaf326a6cdfd87da9195eb9630806c418)
| | * | | Tests: update tests to work with previous commit.Martin Schwenke2011-08-085-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 01c941ab4c764c5aac0d7c0f90fca89775956d41)
| | * | | Tests: eventscripts and onnode tests use stubs/ subdirectory instead of bin/.Martin Schwenke2011-08-0819-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This sets up a more useful convention and avoids future .gitignore problems. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 58c696dc600f1073e693930da061776b6fb199f2)
| | * | | Tests: tweak some samba tests to cope with debug from ctdb_check_tcp_ports().Martin Schwenke2011-08-082-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 557ac30e60516742da10b83bfbbbb41430c977a2)
| | * | | Tests: Oops! Add bin directory for eventscript tests.Martin Schwenke2011-08-0818-0/+705
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was matched by .gitignore. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ef7e5da6241e326267800cd2bd53fb33a0386c2d)
| | * | | Git should ignore tests/eventscripts/var.xMartin Schwenke2011-08-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit bc94197025a1ec6efaed5586a725f698991b2b17)
| | * | | Tests: initial eventscript unit tests.Martin Schwenke2011-08-0860-0/+1650
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b675ca3c25b7155b9681128822d1280018ef68bb)
| * | | | Merge remote branch 'martins/eventscripts_relative'Ronnie Sahlberg2011-08-1011-145/+102
| |\ \ \ \ | | | |/ / | | |/| | | | | | | (This used to be ctdb commit cf61c5d1517d3979ce67e7b9bc836d040db8a416)
| | * | | Scripts: remove absolute paths from interface_modify.sh.Martin Schwenke2011-08-081-7/+7
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (This used to be ctdb commit 2702592b5911cfa93625e36f4a0d1c4414c0e3e9)
| | * | Merge remote-tracking branch 'origin/master' into eventscripts_relativeMartin Schwenke2011-08-0838-272/+1653
| | |\ \ | | | | | | | | | | | | | | | (This used to be ctdb commit b723f23fc9c38e75b91d43306d606be26c55d31d)
| | * | | Eventscript functions - use $CTDB_VARDIR instead of local $ctdb_spool_dir.Martin Schwenke2011-08-081-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d0c6d9b19f0dd8946f9504b0d1cf50dd21f7a592)