1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

3683 Commits

Author SHA1 Message Date
Martin Schwenke
06f1004da4 Merge branch 'eventscript.20.multipathd' into eventscript.00.ctdb
(This used to be ctdb commit 8723b88b0b2bbeece38c74c77c50e8d8b3e2d5ca)
2011-08-10 15:32:58 +10:00
Martin Schwenke
383b203096 Merge branch 'eventscript.62.cnfs' into eventscript.20.multipathd
(This used to be ctdb commit fb87fa9273db4f82e801a331b5d95059d64dfb8e)
2011-08-10 15:32:11 +10:00
Martin Schwenke
7eae4aafca Merge branch 'eventscript.13.per_ip_routing' into eventscript.62.cnfs
(This used to be ctdb commit cfa4102ec0d97e1d1d3c1ce6407ffacdb85c2e10)
2011-08-10 15:31:13 +10:00
Martin Schwenke
098da255fa Evenscripts: update 61.cnfs to use ctdb_setup_service_state_dir.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit afafeb1fb12384bddff470d38b534f513a1f3b07)
2011-08-10 12:27:41 +10:00
Martin Schwenke
061b7adad6 Evenscripts: update 13.per_ip_routing to use ctdb_setup_service_state_dir.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 18e0236754507a9475653f04bb239c5d46ba51de)
2011-08-09 17:35:37 +10:00
Martin Schwenke
609a1e5c77 Evenscripts: update 20.multipathd to use ctdb_setup_service_state_dir.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 797ca65bdd59b14325ffd32b4d4140e9b01dbe71)
2011-08-09 17:28:09 +10:00
Martin Schwenke
f36bae1cbf 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>

(This used to be ctdb commit 1b3f2dd62efb240f8486016fe0f8dfb73d6ccc66)
2011-08-09 16:48:57 +10:00
Martin Schwenke
dd56cde3ff 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>

(This used to be ctdb commit a5ce2adaa39f077f56582072a97bb64d0eba4b4d)
2011-08-09 16:45:50 +10:00
Martin Schwenke
cbf030a72e 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>

(This used to be ctdb commit 28379ca0f747c5952d690a451834ce7421adfd34)
2011-08-09 16:42:27 +10:00
Martin Schwenke
71e9016ec2 Scripts: add note about not using absolute command paths to README.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 87e6a4a23a6ae6c276e9628ce513663f47b4ee77)
2011-08-09 16:36:37 +10:00
Martin Schwenke
d81c1319e9 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>

(This used to be ctdb commit 5ae002c7513b1b2aa5136437a1a19f8cd179b869)
2011-08-09 16:36:37 +10:00
Martin Schwenke
ee38b9a159 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>

(This used to be ctdb commit a273554791c2a5281aee28f8e2be0c514e14c91e)
2011-08-09 16:35:07 +10:00
Martin Schwenke
ec33c04283 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>

(This used to be ctdb commit 9a084a121f629b2c1bcefc1e4c4a4a5cacf53987)
2011-08-09 16:20:08 +10:00
Martin Schwenke
a0ffea9ff7 Merge branch 'test_suite' into ronnie_target
(This used to be ctdb commit 414c4d8e901353a3529f82746ffe2e4983a155d6)
2011-08-09 13:12:08 +10:00
Martin Schwenke
a684ecc8fa Merge branch 'eventscript_tests' into ronnie_target
(This used to be ctdb commit 432e6c1d5137142ce6b0314a965747524406c17e)
2011-08-09 13:11:38 +10:00
Martin Schwenke
2042931ae6 Test suite: print debug output after cluster (un)healthy flip-flop on restart.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 0e14213dfa841080c07fa6fce23b192493adb926)
2011-08-08 16:39:12 +10:00
Martin Schwenke
f5115a9ea6 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>

(This used to be ctdb commit c12c97598afcd07ce4876b26e0b734bc825e54c1)
2011-08-08 16:38:43 +10:00
Martin Schwenke
47f1a7dd5b 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>

(This used to be ctdb commit 73cfc304513358e99e6505c95f44a4d319201309)
2011-08-08 16:35:55 +10:00
Martin Schwenke
6ffeae85d6 Test suite: Fix consistency in 09_ctdb_ping.sh.
Same problem as described in commit
283a85b42d9c0a26acb64d5abcc7f175e31e6e75.

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

(This used to be ctdb commit 7758fd0591467a758e5d22404aa59fcbc1e1cb8b)
2011-08-08 16:35:22 +10:00
Martin Schwenke
667a743fff 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>

(This used to be ctdb commit 6c8eedb21a5e231d4a26ac26706ea51f348a27e0)
2011-08-08 16:34:48 +10:00
Martin Schwenke
b3db37cd30 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>

(This used to be ctdb commit 98ccdc6241a73036c4f210bb510f1cb5cff588cc)
2011-08-08 16:33:47 +10:00
Martin Schwenke
94f0fd9cd5 Test suite: Try much harder to get a healthy cluster when it is restarted.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 91e74cb01a11012e41ef9633c98f13ddbb2e5908)
2011-08-08 16:28:30 +10:00
Martin Schwenke
d8e342d71a 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>

(This used to be ctdb commit 151151353e58f59b15be9313e22b7d4f71ee0de8)
2011-08-08 16:11:14 +10:00
Martin Schwenke
958414ceeb Tests - Tweak 10.interfaces 802.ad bonding test to work with current code.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d3271d316f6d1561e66cbc4cc1b1e8af63895459)
2011-08-08 15:53:28 +10:00
Martin Schwenke
3e65cdb565 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>

(This used to be ctdb commit 2702592b5911cfa93625e36f4a0d1c4414c0e3e9)
2011-08-08 15:50:44 +10:00
Martin Schwenke
50dc5b01a4 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>

(This used to be ctdb commit 5b4c712aab3edc0059f2e5a6730b7fdcf7e5f4ec)
2011-08-08 15:50:10 +10:00
Martin Schwenke
eec654314a 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>

(This used to be ctdb commit 95d9a1e19655461288a2c7e52abf9d01ab23e05a)
2011-08-08 15:44:30 +10:00
Martin Schwenke
b30143eb78 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>

(This used to be ctdb commit 7130963430e530fa4dd5e6fe132bd7122349cc5f)
2011-08-08 15:42:45 +10:00
Martin Schwenke
7e5c48c84c 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>

(This used to be ctdb commit 4fa2073649f25993de4b8ef6b3e7172068a83a29)
2011-08-08 14:45:30 +10:00
Martin Schwenke
72362e7b56 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>

(This used to be ctdb commit b13ac3bdaf326a6cdfd87da9195eb9630806c418)
2011-08-08 13:51:32 +10:00
Martin Schwenke
2c9c77f6dc 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>

(This used to be ctdb commit 01c941ab4c764c5aac0d7c0f90fca89775956d41)
2011-08-08 13:47:13 +10:00
Martin Schwenke
506be3cb26 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>

(This used to be ctdb commit 58c696dc600f1073e693930da061776b6fb199f2)
2011-08-08 13:38:07 +10:00
Martin Schwenke
604eb67102 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>

(This used to be ctdb commit 557ac30e60516742da10b83bfbbbb41430c977a2)
2011-08-08 13:38:07 +10:00
Martin Schwenke
2396846ca1 Tests: Oops! Add bin directory for eventscript tests.
It was matched by .gitignore.

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

(This used to be ctdb commit ef7e5da6241e326267800cd2bd53fb33a0386c2d)
2011-08-08 13:38:07 +10:00
Martin Schwenke
652899e692 Git should ignore tests/eventscripts/var.x
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit bc94197025a1ec6efaed5586a725f698991b2b17)
2011-08-08 13:38:07 +10:00
Martin Schwenke
f43ae500be Tests: initial eventscript unit tests.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b675ca3c25b7155b9681128822d1280018ef68bb)
2011-08-08 13:38:07 +10:00
Martin Schwenke
46c908d542 Merge remote-tracking branch 'origin/master' into eventscripts_relative
(This used to be ctdb commit b723f23fc9c38e75b91d43306d606be26c55d31d)
2011-08-08 13:25:40 +10:00
Martin Schwenke
394bbe8454 Eventscript functions - use $CTDB_VARDIR instead of local $ctdb_spool_dir.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d0c6d9b19f0dd8946f9504b0d1cf50dd21f7a592)
2011-08-08 13:21:23 +10:00
David Disseldorp
e097b7f8ff 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

(This used to be ctdb commit 9ea41d2fab612772f861270c8a59c01c43bd3a4c)
2011-08-05 14:27:18 +10:00
Ronnie Sahlberg
fea64f65b5 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

(This used to be ctdb commit f2fe0a090a9650910ebe49514b3ca01dc593bea3)
2011-08-05 10:05:12 +10:00
Martin Schwenke
b0e7237653 Eventscripts - remove some more absolute paths to commands.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f5b7cb03aaf19fb4b12fc3f0c14d98ee2d7b0798)
2011-08-04 17:14:11 +10:00
Ronnie Sahlberg
10caf186e1 remove log message we dont need
S1026492

(This used to be ctdb commit c5f6e44b92210519d4bfc24611cae3f9978cc2e5)
2011-08-04 13:49:57 +10:00
Ronnie Sahlberg
a9eba762d7 remove a non-error logmessage about persistent databases being healthy, as expected
S1026492

(This used to be ctdb commit da9e02085523e27fa29e35c60034f6a8aaaa81e8)
2011-08-04 13:49:48 +10:00
Ronnie Sahlberg
629f4da55a remove a log message we dont need about "allow clients to attach to databases"
S1026492

(This used to be ctdb commit 42c3e4c5216000c370814441e38c7a8180047aaf)
2011-08-04 13:49:38 +10:00
Ronnie Sahlberg
44dd9b458d Change the message when we start the daemon to "CTDB starting on node"
S1026492

(This used to be ctdb commit 4dfe85dc19eea7b3382a005f63e1a3ef824aea90)
2011-08-04 13:49:30 +10:00
Martin Schwenke
8026b3ce5a 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>

(This used to be ctdb commit 2dfdc997f432d522034922b43cb6f8f878d11ba7)
2011-08-03 20:12:48 +10:00
Martin Schwenke
6fd94af5cc Eventscripts: update 60.nfs service() start to use set_proc().
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 70ebb30b90956bb1212287d267ccb72ea83740ca)
2011-08-03 20:01:38 +10:00
Martin Schwenke
4b516600a2 Eventscripts: update 10.interface to use set_proc() and get_proc().
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 61b7f0172ba5c83c847c29fac3582c25c7754b68)
2011-08-03 19:58:25 +10:00
Martin Schwenke
cfdccc5cac Eventscripts: use set_proc() in startstop_nfs().
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5a3d5c6b1ca3682bb45104e50061871dec6e9b1d)
2011-08-03 19:57:40 +10:00
Martin Schwenke
75bbc93c0b 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>

(This used to be ctdb commit 05851d50b0078de8bf4691442d718825adca6fe8)
2011-08-03 17:19:15 +10:00