summaryrefslogtreecommitdiff
path: root/ctdb/config
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-scripts: Drop "net serverid wipe" from 50.samba event scriptAmitay Isaacs2018-04-101-2/+0
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13359 There is no serverid database anymore. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Sat Mar 31 08:34:00 CEST 2018 on sn-devel-144 (cherry picked from commit 6b75d2c650aa9ee632122fa87ea8a2a98f1fa613)
* systemd: Add documentation to Unit filesMathieu Parent2018-01-141-0/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12402 Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* ctdb-scripts: Don't bother checking PID file when starting ctdbdMartin Schwenke2017-11-071-16/+2
| | | | | | | | | | | | | | This is an optimisation that can cause incorrect results. If ctdbd was killed and there is a stale PID file then this will often cause "CTDB exited during initialisation". The wrapper reads the old PID from the PID file, finds the PID gone, complains and exits. It is better to drop this code and finally get this right. If ctdbd does exit early then it will take CTDB_STARTUP_TIMEOUT (default 10) seconds before the wrapper fails. That's not too bad... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Ignore event scripts with multiple '.'sAmitay Isaacs2017-10-181-1/+3
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13070 This avoids running event script copies left by a package manager. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: Switch ctdb_check_unix_socket() to use ssMartin Schwenke2017-09-121-1/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Clean up ctdb_check_unix_socket()Martin Schwenke2017-09-121-8/+13
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Ignore shellcheck SC2181 warning (use of $?)Martin Schwenke2017-08-141-0/+2
| | | | | | | | | | | | | Given the size of the command substitutions it would be less clear to embed the assignments and substitutions inside a conditional. It is clearer if the exit code is checked afterwards. However, do fix some untidy uses of != instead of -ne when comparing with $?. Make the code easier to understand by reversing the logic and using -eq and ||. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Avoid shellcheck warning SC2188 (redirect without command)Martin Schwenke2017-08-141-3/+3
| | | | | | | | This makes the code look deliberate instead like something has been accidentally omitted. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fix a typoMartin Schwenke2017-07-231-1/+1
| | | | | | | | This is a regression introduced in commit e847ec3ae24cc6c8c69284c7fe0791a319cf7142 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-docs: Update documentation of ipreallocated eventMartin Schwenke2017-07-131-18/+17
| | | | | | | | | | | This was out of date due to the removal of service_check_reconfigure() and similar. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Thu Jul 13 17:57:11 CEST 2017 on sn-devel-144
* ctdb: enable mutexes for volatile TDBs by defaultRalph Boehme2017-07-121-1/+1
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fix inline comments in 10.interfaceAnoop C S2017-07-111-1/+1
| | | | | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Jul 11 11:45:04 CEST 2017 on sn-devel-144
* ctdb-scripts: Don't send empty argument string to loggerAmitay Isaacs2017-06-241-1/+1
| | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12856 This stops logger reading from stdin. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Sat Jun 24 14:37:48 CEST 2017 on sn-devel-144
* ctdb-scripts: Compact server-end TCP connection killing outputMartin Schwenke2017-06-131-8/+14
| | | | | | | | | | | | | | | | | | | | When thousands of connections are being killed the logs are flooded with information about connections that should be killed. When some connections are not killed then the number not killed is printed. This is the wrong way around! When debugging "fail-back" problems, it is important to know details of connections that were *not* killed. It is almost never important to know the full list of all connections that were *supposed* to be killed. Instead, print a summary showing how many connections of the total were killed. If any were not killed then print a list of remaining connections. Update unit tests: infrastructure for fake TCP connections, existing, test cases, add new test cases. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: NFS call-out failures should cause event failureMartin Schwenke2017-06-131-4/+4
| | | | | | | | | | Failures in startup/shutdown/releaseip/takeip are currently incorrectly ignored. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12837 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Initialise CTDB_NFS_CALLOUT in statd-calloutMartin Schwenke2017-02-161-0/+1
| | | | | | | | | | | | | | | | | | | | Some configurations may set CTDB_NFS_CALLOUT to the empty string. They may do this if they allow a choice of NFS implementations. In this case the default call-out for Linux kernel NFS should be used. However, statd-callout does not call nfs_callout_init() to set the default. Therefore, statd-callout is unable to restart the lock manager, so the grace period is never entered. statd-callout must call nfs_callout_init() before trying to restart the lock manager. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12589 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu Feb 16 09:21:03 CET 2017 on sn-devel-144
* ctdb-scripts: Avoid log noise when NFS checks directory is emptyMartin Schwenke2017-01-201-0/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fix regression when cleaning up routing table IDsMartin Schwenke2017-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | Commit 0ca00267cd2620a14968961738bcd2a69b597e95 removed explicit continuations in strings for awk programs. In one case this causes a disconnect between condition and action, where an implicit continuation does not work. This results in duplicate lines in the rt_tables file. Move the opening brace for the action to make the implicit continuation work as expected. An alternative would be to revert the removal of the explicit continuations and add shellcheck tags. However, that doesn't mean that an author of future code will necessarily use explicit continuations, so the same mistake might still be make in the future. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12516 Reported-by: Barry Evans <bevans@pixitmedia.com> Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fix remaining uses of "ctdb gratiousarp"Martin Schwenke2017-01-173-5/+5
| | | | | | | | | | | | | This changed to "ctdb gratarp" some time ago but the scripts were never updated. Fix the documentation for the ctdb tool too. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12512 Reported-by: Ralph Böhme <slow@samba.org> Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop configuration variable CTDB_SCRIPT_DEBUGLEVELMartin Schwenke2017-01-161-20/+0
| | | | | | | | The debug() function, which is the only user of this variable, is no longer used. It is also dropped. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop function ctdb_check_command()Martin Schwenke2017-01-162-16/+5
| | | | | | | This is only used in 1 place, so just inline the check. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Inline simple uses of service_start() and service_stop()Martin Schwenke2017-01-162-20/+6
| | | | | | | This makes the scripts more readable. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Remove ctdb_service_start() and ctdb_service_stop()Martin Schwenke2017-01-166-58/+15
| | | | | | | | | | They contain too much unnecessary complexity, some of which was used to support CTDB_SERVICE_AUTOSTARTSTOP. Also removed unused functions for service management. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop unnecessary function ctdb_check_tcp_init()Martin Schwenke2017-01-161-19/+0
| | | | | | | The flag this sets is no longer used by ctdb_check_tcp_ports() Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Simplify TCP port checkingMartin Schwenke2017-01-161-38/+31
| | | | | | | | | | | | | | | Commit 86792724a2a911da9cd3e75622d35084c88eb8ce added complications on top of the multiple TCP port checking methods that used to exist. Life is simpler now and the cause of any failures is obvious. So just print a simple message if the port check fails. Tweak tests to match changes. Drop one test that becomes a duplicate. Temporarily tweak ctdb_check_command() so that it passes shellcheck tests. It will be removed anyway in a subsequent commit. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop configuration variable CTDB_SERVICE_AUTOSTARTSTOPMartin Schwenke2017-01-169-67/+0
| | | | | | | | | | | | | | | | | | | | | | This has bit-rotted, at least for NFS. It can be fixed but it is better to remove it because it adds a lot of unnecessary complexity. Variable event_name becomes unused so remove it. Also remove associated tests. To continue to manage/unmanage services while CTDB is running: * Start service by hand and then flag it as managed * Mark service as unmanaged and shut it down by hand In some cases CTDB does something fancy - e.g. start Samba under "nice", so care is needed. One technique is to disable the eventscript, mark as managed, run the startup event by hand and then re-enable the eventscript. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop ctdb_check_service_reconfigureAmitay Isaacs2016-12-161-133/+0
| | | | | | | | | | This gets rid of implicit check if a service needs to configured. As a side effect, we also get rid of the monitor "replay" which was introduced to avoid a collision between a script executed via event and manually. Event scripts are not expected to be run by hand. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: Add explicit check for service reconfigurationAmitay Isaacs2016-12-163-6/+16
| | | | | | | | | | | | This will help get rid of implicit ctdb_service_check_reconfigure. We still need to keep "reconfigure" event in 13.per_ip_routing, so that the per ip routing can be refreshed if the configuration has changed. The correct fix for this is to add caching of configuration and checking of configuration changes in "ipreallocated" event. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: Update CTDB_SCRIPT_DEBUGLEVEL to be symbolicMartin Schwenke2016-12-051-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fix Debian init in samba eventscriptMathieu Parent2016-11-071-2/+2
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12371 Signed-off-by: Mathieu Parent <math.parent@gmail.com> Signed-off-by: Stefan Kania <stefan@kania-online.de> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fix calculation of CTDB_BASEAmitay Isaacs2016-11-034-4/+4
| | | | | | | | | | | | This is a regression introduced in f227c26178c2eaf3fae49f32a90ec905f85005f4. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12407 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu Nov 3 10:10:31 CET 2016 on sn-devel-144
* ctdb-scripts: Strengthen check to see if ctdbd is runningMartin Schwenke2016-10-141-5/+9
| | | | | | | | | | Don't just rely on the process existing. It must be called "ctdbd". Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Fri Oct 14 11:54:40 CEST 2016 on sn-devel-144
* ctdb-scripts: Drop backward compatibility from ctdbd_is_running()Martin Schwenke2016-10-131-40/+9
| | | | | | | | | | The PID file has been used since CTDB 2.3. Assume that anyone upgrading from an older version does a clean shutdown, upgrades CTDB and then does a clean start (as opposed to upgrade CTDB and then restart). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-scripts: ctdbd_wrapper should never remove the PID fileMartin Schwenke2016-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | kill_ctdbd() kills the daemon and then removes the PID file. This is racy because a new daemon could write a new PID file in between the kill and the removal. Reversing these steps would be an improvement. However, none of the places where kill_ctdbd() is called is a safe place to remove the PID file. There is always a chance that a new daemon could start, write a new PID file and then kill_ctdbd() could remove the new PID file. ctdbd is able to overwrite a stale PID file by checking to see if it is locked. Therefore, entirely drop removal of the PID file from ctdbd_wrapper. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12287 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-scripts: Dump stack traces of smbd processes after shutdownMartin Schwenke2016-10-101-0/+1
| | | | | | | | | | | | | | If any processes remain then they may be stuck in D state and this might tell us why. Update tests: tweak pidof stub, add support for smbd stack traces and add some new tests for the shutdown event. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon Oct 10 12:54:24 CEST 2016 on sn-devel-144
* ctdb-packaging: Fix systemd network dependencyMartin Schwenke2016-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ says: network.target has very little meaning during start-up. [...] Whether any network interfaces are already configured when it is reached is undefined. [...] network-online.target is a target that actively waits until the ne[t]work is "up", CTDB expects to be able to bind a socket to a node address and expects interfaces for public IP addresses to exist. CTDB also doesn't expect time to jump, so also wait until time is synchronised. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12255 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Steve French <sfrench@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Tested-by: Steve French <sfrench@samba.org>
* ctdb-scripts: Optimise tickle_tcp_connections()Martin Schwenke2016-09-081-14/+5
| | | | | | | | | | | | Pipe the connections to "ctdb tickle" on stdin to avoid having to fork so many "ctdb tickle" processes. This maintains the current level of verbosity at the price of some extra memory usage. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Thu Sep 8 10:45:42 CEST 2016 on sn-devel-144
* ctdb-scripts: Optimise update_tickles()Martin Schwenke2016-09-081-8/+4
| | | | | | | Use addtickle and deltickle with stdin. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add early exit for redundant updateipMartin Schwenke2016-08-171-0/+7
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-packaging: Move ctdb configuration to ctdbd.confAmitay Isaacs2016-07-281-3/+3
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools: Simplify "ctdb pnn" output formatMartin Schwenke2016-07-251-1/+1
| | | | | | | | | Just print the PNN. Update dependent code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Avoid chellcheck warning SC2012 (ls for file list)Martin Schwenke2016-07-211-5/+7
| | | | | | | | | | | | | | | | SC2012: Use find instead of ls to better handle non-alphanumeric filenames. Make this cope better with unexpected whitespace. Unfortunately, this results in shellcheck warning: SC2035: Use ./*.tdb.* so names with dashes won't become options. No! Then stat(1) will print ./file.tdb.X. We want the basenames and we know the filenames don't start with dashes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Avoid shellcheck warning SC2012 (ls for file list)Martin Schwenke2016-07-211-3/+6
| | | | | | | SC2012: Use find instead of ls to better handle non-alphanumeric filenames. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Avoid shellcheck warning SC2038 (find without -print0)Martin Schwenke2016-07-211-1/+3
| | | | | | | | | | | | SC2038: Use -print0/-0 or -exec + to allow for non-alphanumeric filenames. The suggested options aren't POSIX-compliant. This is more portable. Base filenames can't have whitespace so rework to avoid problems with whitespace in directory name. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Avoid shellcheck warning SC2039 (non-portable ulimit options)Martin Schwenke2016-07-211-0/+4
| | | | | | | | | | | SC2039: In POSIX sh, ulimit -c/-n is not supported. Have shellcheck suppress the warnings. If -n is not supported then don't set CTDB_MAX_OPEN_FILES. If packaging for a platform where -c is not supported then remove this code and associated documentation. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Avoid shellcheck warning SC2039 (test -nt operator)Martin Schwenke2016-07-211-0/+2
| | | | | | | | | | | | SC2039: In POSIX sh, -nt is not supported. This script is specific to the Linux NFS implementation. The -nt operator is well supported in Linux shells (e.g. dash, bash, ksh). The alternatives (e.g. using stat(1)) would result in less readable code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Avoid shellcheck warning SC2094 (read/write same file)Martin Schwenke2016-07-212-28/+33
| | | | | | | | | | SC2094: Make sure not to read and write the same file in the same pipeline. The semantics here are unclear, so use a separate flock file in each case for clarity. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Avoid shellcheck warning SC2039 (echo -n)Martin Schwenke2016-07-214-8/+9
| | | | | | | | | | | | SC2039: In POSIX sh, echo flags are not supported. echo -n is well supported but the changes are simple. Improve some logic, replace some instances with printf. Who knew printf was in POSIX? Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Avoid shellcheck warning SC2039 (type command)Martin Schwenke2016-07-213-0/+6
| | | | | | | | | SC2039: In POSIX sh, 'type' is not supported. type is commonly supported and is more portable than which(1). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Avoid shellcheck warning SC2015 (A && B || C)Martin Schwenke2016-07-211-0/+3
| | | | | | | | SC2015: Note that A && B || C is not if-then-else. C may run when A is true. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>