1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-05 09:18:06 +03:00
Commit Graph

72 Commits

Author SHA1 Message Date
Martin Schwenke
14b3c37d9d onnode - respect $CTDB_BASE rather than hard-coding /etc/ctdb.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a9aa2e06774e8cd59a86d3343d3da2a2769561b5)
2010-01-21 13:16:18 +11:00
Martin Schwenke
787a6e44c6 New onnode options: -f to specify nodes file, -n to allow use of hostnames.
The -f option allows an alternate nodes file to be specified,
overriding the CTDB_NODES_FILE environment variable.

The -n option allows hostnames to be used instead of node numbers.
Using a range of hostnames is invalid, so hostnames can't contain
hyphens ('-') - sorry!  You can use this option without a nodes file
by specifying "-f /dev/null".

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 46474e5f21fd97dd765c616647ff46055a9970e7)
2009-10-14 13:44:57 +11:00
Ronnie Sahlberg
029fd6b00f Revert "try to restart statd everytime it fails, not just the first time"
This reverts commit 4f7b39a4871af28df1c4545ec37db179fa47a7da.

(This used to be ctdb commit db7b96304e4725f29b12398b7582e385daed63ed)
2009-09-15 19:33:35 +10:00
Ronnie Sahlberg
59cacded72 try to restart statd everytime it fails, not just the first time
(This used to be ctdb commit 4f7b39a4871af28df1c4545ec37db179fa47a7da)
2009-09-15 13:35:58 +10:00
Martin Schwenke
021892346c onnode: add "any" nodespec to select any node with running CTDB.
In testing and other situations (e.g. eventscripts) it is necessary to
select a node where a ctdb command can be run.  The whole idea here is
to avoid nodes where ctdbd is not running and where most ctdb commands
would fail.  This implements a standard way of doing this involving a
recursive onnode command.

There is still a small window for a race, where the selected node is
suddenly shutdown, but this is unavoidable.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit fb47cce86c0edae5caaf485f13ae7a151b6cb00d)
2009-09-08 15:10:20 +10:00
Martin Schwenke
50650fbbd1 onnode: update tests for healthy and connected to cope with new stopped bit.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit bfc926c866e361ab28330747544b268ba130bf30)
2009-07-28 16:00:11 +10:00
Martin Schwenke
4697829e7c Fix minor onnode bugs relating to local daemons.
Commit a0f5148ac749758e2dfbd6099e829c5bf1d900e6 caused a subtle
regression.  Due to the subtlety, this description is much longer than
the 1 line patch that fixes it!  The regression, where a process that
invokes onnode is unexpectedly blocked, is only apparent if the
following conditions are met:

1. $CTDB_NODES_SOCKETS is set;
2. The command passed to onnode attempts to background a process; and
3. onnode is run in certain types of subshell (e.g. foo=$(onnode ...)).

In particular, when testing against local daemons (i.e. condition (1)
is met), tests/simple/07_ctdb_process_exists.sh would fail (because it
does both (2), (3)).

The problem is caused by the use of file descriptor 3 in the code that
allows separate filtering of stdout and stderr.  A backgrounded
process will have this descriptor open and the $(...) construct
appears to wait for all file descriptors to be closed.  This only
happens with local daemons because SSH is replaced by a shell and file
descriptor 3 leaks into that shell.  It does not occur when SSH is
used because the file descriptor does not leak into the remote shell
where the process is backgrounded.

The fix is simply to redirect file descriptor 3 to /dev/null in the
fakessh function, which is used when $CTDB_NODES_SOCKETS is set.

Also fixed is another minor bug when the -o option and
$CTDB_NODES_SOCKETS are used in combination.  The code uses the node
name as a suffix for the output filename(s).  Usually this is an IP
address.  However, when $CTDB_NODES_SOCKETS is in use the node name is
the socket name, which might be a path several directories deep.
Each output file is created via a simple redirection and this would
fail if unexpected directories appear in the filename.  3 possible
fixes were considered:

1. Replace all '/'s in the node name by '_'s.  Nice and simple.
2. Use the basename of the node name.  However, sockets may be in
   different directories but have the same basename.
3. Create all required directories before redirecting.  This is a
   little more complex and probably doesn't meet the user's
   expectations.

Option (1) is implemented here.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c97d56d93d9c1007a4e85affb19ed0c2d0e11b6d)
2009-06-19 12:12:39 +10:00
Ronnie Sahlberg
45aa542064 teach ONNODE about deleted nodes
(This used to be ctdb commit 03d304e72a5839dc8d8d2e2312b346c21dca5774)
2009-06-02 15:03:44 +10:00
Martin Schwenke
53c9643104 Fix lvsmaster and natgwlist nodespecs.
They both need to use a -Y option to ctdb and for natgwlist we only
want the 1st line.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e781ff61e17d733349021bb036514f823c7cbfbb)
2009-05-12 08:58:57 +10:00
Martin Schwenke
6098464175 New lvs/lvsmaster and natgw/natgwlist nodespecs for onnode.
Some code re-factoring to implement this and to make it easy to
implement new ones.  New simpler implementation of echo_nth() no
longer uses deleted get_nth() function.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 29559f5dd099bec210e98909c9b2e048461b7c81)
2009-05-12 08:58:23 +10:00
Martin Schwenke
9616959bd6 New option "-o <prefix>" saves stdout from each node to file <prefix>.<ip>.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a0f5148ac749758e2dfbd6099e829c5bf1d900e6)
2009-05-12 08:58:04 +10:00
Martin Schwenke
d741559fa6 Add some simple tests that can be run from within the tree.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit eacb2ef82ea4809d874158756db973dd1e3fc8fc)
2008-11-20 20:40:01 +11:00
Martin Schwenke
62a65ebc38 onnode changes. "ok" is an alias for "healthy", "con" is an alias for
"connected".  Allow "rm" or "recmaster" to be a nodespec for the
recovery master. Better error handling for interaction with ctdb
client.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 05bdafed82106a0d8bfa53cd730eb3e1db68a51f)
2008-09-12 16:55:18 +10:00
Martin Schwenke
0013ec94de Changes to onnode. Add "healthy" and "connected" as possible
nodespecs.  Since we're now explicitly using bash, use local variables
when sensible.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 16626eaf9c63adfe780e8f51f9cd97810647e731)
2008-09-12 11:22:50 +10:00
Martin Schwenke
e78ebc8184 Merge commit 'origin/master' into martins
(This used to be ctdb commit 79ad588d61a56a062c043eae6aba3370ec10ac61)
2008-09-12 10:34:03 +10:00
Andrew Tridgell
3fa8aaa4e2 fixed up exit status for onnode
(This used to be ctdb commit c26afe26cc5c1f9cd9eef74166b5fc39dde591d3)
2008-07-14 09:19:22 +10:00
Martin Schwenke
75fa863677 Signed-off-by: Martin Schwenke <martin@meltin.net>
Minor fix to tools/onnode usage message.

(This used to be ctdb commit 81dd4155e92fc9d11ac788a97a5fd3c50488cc80)
2008-07-11 14:57:24 +10:00
Martin Schwenke
ccb51aabe5 Signed-off-by: Martin Schwenke <martin@meltin.net>
In tools/onnode, remove reference to -t option in usage message.

(This used to be ctdb commit f2e6b7e9d130eba9132eddda1a5e244a542a23ed)
2008-07-11 12:52:01 +10:00
Martin Schwenke
a92de86c2f When in verbose mode with -p, each line is prefixed with the node
address/name.  To implement this stderr has redirected to stdout -
this doesn't need to be done but is the simplest implementation.
Remove -t option since it doesn't seem to accomplish much but causes
spurious messages to be displayed by ssh.  Add explicit -h and --help
options.  Make style of usage message consistent with documentation.
Document new features in doc/onnode.1.xml.

(This used to be ctdb commit dfaf2c1581e547df831b3171ad47acd27b4ca2af)
2008-07-10 15:41:11 +10:00
Martin Schwenke
db55b91317 Complete rewrite of tools/onnode. Remove old tools/onnode.ssh,
tools/onnode.rsh.

(This used to be ctdb commit 2cc9aba3d7e608eccc29c897f710b69f30653bbf)
2008-07-10 15:39:30 +10:00
Martin Schwenke
f81d0022c4 When in verbose mode with -p, each line is prefixed with the node
address/name.  To implement this stderr has redirected to stdout -
this doesn't need to be done but is the simplest implementation.
Remove -t option since it doesn't seem to accomplish much but causes
spurious messages to be displayed by ssh.  Add explicit -h and --help
options.  Make style of usage message consistent with documentation.
Document new features in doc/onnode.1.xml.

(This used to be ctdb commit 8119238d1fa672814a7591593b517c3c42859315)
2008-07-10 14:19:52 +10:00
Martin Schwenke
55ebe458ef Complete rewrite of tools/onnode. Remove old tools/onnode.ssh,
tools/onnode.rsh.

(This used to be ctdb commit 6b67f180668c7a05c941b4891bd2486601790165)
2008-07-09 14:18:15 +10:00