summaryrefslogtreecommitdiff
path: root/ctdb/tools
Commit message (Collapse)AuthorAgeFilesLines
* ctdb: Fix build on AIXAmitay Isaacs2018-07-101-3/+3
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 40a8ab1ce0c1b291af7263da13c25c37cee69670)
* ctdb-tools: Drop duplicate output from dbstatisticsAmitay Isaacs2017-10-231-1/+0
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Add req_tunnel counts to ctdb statisticsAmitay Isaacs2017-10-101-0/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools: Replace parse_ip() -> ctdb_sock_addr_from_string()Martin Schwenke2017-10-051-7/+17
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Replace parse_ip_port() -> ctdb_sock_addr_from_string()Martin Schwenke2017-10-051-6/+12
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Use ctdb_connection_list_read()Martin Schwenke2017-10-051-23/+21
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: Centralize ctdb_version_stringVolker Lendecke2017-09-261-2/+2
| | | | | | | | | | | Whenever the current git hash changes, we recompile ctdb.c and ctdb_daemon.c. As both have quite a few warnings with -Wall, this makes it quite difficult to see the real warnings that pop up during development. Centralize the ctdb_version_string to just a single file without warnings. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tool: Update process-exists command to pass optional srvidAmitay Isaacs2017-09-211-6/+26
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools: Fix a typo for a talloc contextMartin Schwenke2017-09-191-1/+1
| | | | | | | | 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): Tue Sep 19 17:31:18 CEST 2017 on sn-devel-144
* ctdb-tools: Add debug to ctdb_killtcpMartin Schwenke2017-09-191-0/+8
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Move special case of 0 connections into computationMartin Schwenke2017-09-191-6/+6
| | | | | | | | This avoids other potential users from unnecessarily setting up file descriptors and such. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Rework killtcp logic into a tevent_req-based computationMartin Schwenke2017-09-191-107/+135
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: New function ctdb_kill_tcp_init()Martin Schwenke2017-09-191-94/+79
| | | | | | | | | | | | This replaces ctdb_killtcp(), which did the initialisation inside a loop. The new logic is inverted, making it more natural. The variable containing all the state is called "state" in anticipation of the next commit that will convert this to a tevent_req computation. This will mean less churn. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Improve error handlingMartin Schwenke2017-09-191-6/+15
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Drop global variable progMartin Schwenke2017-09-191-5/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Use db_hash in ctdb_killtcpMartin Schwenke2017-09-191-125/+67
| | | | | | | | One less use of trbt_tree_t. The code is easier to read and is significantly smaller. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Use ctdb_connection and ctdb_connection_list structsMartin Schwenke2017-09-191-39/+46
| | | | | | | Also use new connection and sock addr utilities. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-protocol: Optionally print port for address printing functionsMartin Schwenke2017-09-192-32/+31
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-build: Split protocol-util as a separate subsystemMartin Schwenke2017-09-193-2/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Drop monitoring-related ctdb commandsMartin Schwenke2017-09-141-64/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix CID 1414746Amitay Isaacs2017-09-091-1/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools: Use ssize_t instead of int for checking the status of read()Amitay Isaacs2017-09-091-4/+6
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools: Remove broken natgwlist commandMartin Schwenke2017-09-011-29/+0
| | | | | | | The replacement was documented for Samba 4.5, so this is not worth fixing. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-protocol: Fix marshalling for ctdb_rec_bufferAmitay Isaacs2017-08-301-1/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Fix marshalling for ctdb_ltdb_headerAmitay Isaacs2017-08-301-2/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools: Drop check_srvids command from ctdb toolAmitay Isaacs2017-08-141-40/+0
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools: Remove duplicate codeMartin Schwenke2017-08-141-3/+0
| | | | | | | | | | | These lines are duplicates of those above. It has always been this way... 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 Aug 14 09:00:45 CEST 2017 on sn-devel-144
* ctdb-scripts: Ignore shellcheck SC2181 warning (use of $?)Martin Schwenke2017-08-142-2/+8
| | | | | | | | | | | | | 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-tools: Avoid shellcheck SC2181 warnings (use of $?) in onnodeMartin Schwenke2017-08-141-10/+6
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Use a clear and readable if-statementMartin Schwenke2017-08-141-2/+2
| | | | | | | This is consistent with the if-statement above. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Reformat and explain complex codeMartin Schwenke2017-08-141-2/+21
| | | | | | | | | There are multiple command groups and redirects on very long lines. Reformat the long lines to break them up and add a comment to explain what is happening. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Avoid shellcheck SC2188 warning (redirect without command)Martin Schwenke2017-08-141-1/+1
| | | | | | | Shellcheck found a bug! Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Allow attach for replicated databasesAmitay Isaacs2017-06-291-27/+39
| | | | | | | ... and update the output from various database query commands. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Move eventd API to a separate headerAmitay Isaacs2017-06-071-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Move sync API to a separate headerAmitay Isaacs2017-06-071-0/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Move ctdb_ctrl_modflags() to ctdb toolAmitay Isaacs2017-06-071-0/+34
| | | | | | | This function is only required by the tool. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Add async api for detaching a databaseAmitay Isaacs2017-06-071-2/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools: Use traverse api to re-implement ctdb catdb commandAmitay Isaacs2017-06-071-82/+7
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Rename ctdb_db_travese to ctdb_db_traverse_localAmitay Isaacs2017-06-071-2/+2
| | | | | | | This function only traverses the database on local node. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools: Always exit with positive return valueAmitay Isaacs2017-05-301-1/+2
| | | | | | | | 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): Tue May 30 08:05:56 CEST 2017 on sn-devel-144
* ctdb-tools: "ctdb nodestatus" should only display header for "all"Martin Schwenke2017-05-261-8/+16
| | | | | | | | | | | | | The "Number of nodes:" header should only be displayed when "all" is specified. This is how the command behaved in Samba <= 4.4. Printing the number of nodes is not helpful and is rather confusing in the default case where only the status of the current node is printed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12802 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Stop "ctdb nodestatus" from always showing all nodesMartin Schwenke2017-05-261-5/+0
| | | | | | | | | | | | Exit code should only reflect current or specified nodes too. Drop an unwanted call to get_nodemap() that overwrites the previously calculated node map. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12802 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Avoid deferencing argv[0] if argc == 0Amitay Isaacs2017-03-291-5/+8
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12723 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): Wed Mar 29 11:07:18 CEST 2017 on sn-devel-144
* ctdb: Do not leak fd handle in control_restoredb()Andreas Schneider2017-02-171-0/+1
| | | | | | | | | | | | Found by covscan. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Feb 17 18:43:16 CET 2017 on sn-devel-144
* ctdb-client: Add available-only option public IP fetchingMartin Schwenke2016-12-191-5/+9
| | | | | | | Update tool accordingly. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tool: Drop disablescript, enablescript and eventscript commandsAmitay Isaacs2016-12-181-258/+6
| | | | | | | | | These commands are now replaced with ctdb event ... ctdb scriptstatus is maintained for backward compatibility. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tool: Add new command "event" to ctdb toolAmitay Isaacs2016-12-181-0/+53
| | | | | | | | | | | | | This command covers all the commands to event daemon. ctdb event run <event> ctdb event status [<event>] [lastrun|lastfail|lastpass] ctdb event script list ctdb event script enable <script> ctdb event script disable <script> Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tool: Add helper for talking to event daemonAmitay Isaacs2016-12-181-0/+532
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tool: Improve error reporting if helper execution failsAmitay Isaacs2016-12-181-6/+15
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tool: Allow passing multiple command-line arguments to helperAmitay Isaacs2016-12-181-5/+25
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>