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

235 Commits

Author SHA1 Message Date
Amitay Isaacs
30aa825c1e locking: Add a standalone helper to lock record/db
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a08b6ac19506160f3fb5925ea025027dce07781d)
2013-05-24 09:06:39 +10:00
Amitay Isaacs
6d0c388e5c build: Rename version.h to ctdb_version.h
This avoids clash with version.h from Samba tree.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit d18fcfff674e876abde8d51afec92d9c4a090d2f)
2013-05-23 16:18:23 +10:00
Martin Schwenke
bb39f0a186 scripts: Rework notify.sh to use notify.d/ directory
This makes it easier to add notification handlers.

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

(This used to be ctdb commit d29e9a420b133088bf23a847c8d1dbce56c25eb0)
2013-05-23 16:18:23 +10:00
Christian Ambach
129c12a547 build: Create sudoers.d dir during make install
otherwise make install into non-standard prefix will fail

Signed-off-by: Christian Ambach <ambi@samba.org>

(This used to be ctdb commit 0c0752515b66661ffae24be5f138bd2fab4dec5c)
2013-05-20 19:47:35 +10:00
Martin Schwenke
434f9e8594 eventscripts: 60.nfs uses nfs_check_rpc_services() to check NFS RPC services
* New directory nfs-rpc-checks.d/ replaces hardcoded rules in 60.nfs

* Installation and packaging additions to handle nfs-rpc-checks.d/

* Unit test updates, including deleting 1 test that sanity checked
  test infrastructure

* Test infrastructure changes to use nfs-rpc-checks.d/

Note that this removes support for $CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK in
60.nfs.  To get the equivalent behaviour, edit 20.nfsd.check and
remove/comment all lines.

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

(This used to be ctdb commit 7e792d6768d9ca420ce3713cb122e63afd594b15)
2013-05-07 12:55:09 +10:00
Michael Adam
eaad7c1e62 build: silence building of porting_test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit e96acf19b4d1e0f951ab92b88869a01ff06398be)
2013-04-17 12:43:33 +02:00
Amitay Isaacs
d931e73fb8 statd-callout: Make sure statd callout script always runs as root
In RHEL 6+, rpc.statd runs as "rpcuser" instead of root as on RHEL 5. This
prevents CTDB tool commands talking to daemon since "rpcuser" cannot access
CTDB socket.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit fe8c4880b371492a38554868d4ca10918c54e412)
2013-04-08 11:14:28 +10:00
Martin Schwenke
35074ad6d5 build: Fix a Makefile.in typo
Objects are named *.o  ;-)

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

(This used to be ctdb commit 25a20409fb39a94b64c13990c0eba4f75d482ecd)
2013-02-05 12:13:57 +11:00
Mathieu Parent
52a99cbac6 tests: Test portability
Curiously test_ctdb_sys_check_iface_exists fails on Linux

Signed-off-by: Mathieu Parent <math.parent@gmail.com>

(This used to be ctdb commit 109f428aa34f8f4cc0329880d2f4a5593a6cc6f3)
2013-01-22 18:03:47 +11:00
Mathieu Parent
75625cd572 build: Add missing LDFLAGS
Original Author: Simon Ruderich <simon@ruderich.org>

Signed-off-by: Mathieu Parent <math.parent@gmail.com>

(This used to be ctdb commit 506ecd186759675a1cf50a0a05a285fee03fc51e)
2013-01-22 18:03:31 +11:00
Amitay Isaacs
1a6ccd1bf1 build: Add rules to create include/version.h when building from git tree
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 8df7ea6b20417833792932487a082b3c71bb6837)
2012-10-30 11:55:59 +11:00
Amitay Isaacs
42d8e379fe packaging: Bundle README, COPYING and html version of manpages
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 6871415f6cb50c4f9753067359f0e264d3f93871)
2012-10-22 18:15:17 +11:00
Amitay Isaacs
43b25d1948 build: Extract building of manpages in a separate Makefile
This can then be used to build manpages/html when creating tarball.
Do not build docs during a regular build, but only for install.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 3274cffe2052953b34141a82de6053b747532a88)
2012-10-22 18:15:17 +11:00
David Disseldorp
8cbf1a00c4 Build: Set the default ctdb socket path at configure time
The ctdb socket path currently defaults to /tmp/ctdb.socket and can be
modified at runtime using the --socket=filename option, common to both
ctdb and ctdbd binaries.

This change allows the default path to be set at configure time using
the --with-socketpath=FILE argument. When not specified, the default
path remains /tmp/ctdb.socket, documentation remains unchanged as a
result.

Signed-off-by: David Disseldorp <ddiss@samba.org>

(This used to be ctdb commit f92b9c83a2f39fba9a141417a88de96fc8c592ff)
2012-10-21 01:39:08 +11:00
Amitay Isaacs
a00e50e503 ctdbd: Replace lockwait with locking API and remove ctdb_lockwait.c
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 2126795153dacb255e441abcb36ee05107b6282a)
2012-10-20 02:48:44 +11:00
Amitay Isaacs
83306337df ctdbd: locking: Provide non-blocking API for locking of TDB record/db/alldb
This introduces a consistent API for handling locks on single record, complete
db or all dbs. The locks are taken out in a child process. In cases of timeout,
find the processes that currently hold the lock and log.

Callback functions for locking requests take locked boolean to indicate
whether the lock was successfully obtained or not.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1af99cf0de9919dd89af1feab6d1bd18b95d82ff)
2012-10-20 02:48:44 +11:00
Martin Schwenke
8d7562f3f8 common: Debug ctdb_addr_to_str() using new function ctdb_external_trace()
We've seen this function report "Unknown family, 0" and then CTDB
disappeared without a trace.  If we can reproduce it then this might
help us to debug it.

The idea is that you do something like the following in /etc/sysconfig/ctdb:

  export CTDB_EXTERNAL_TRACE="/etc/ctdb/config/gcore_trace.sh"

When we hit this error than we call out to gcore to get a core file so
we can do forensics.  This might block CTDB for a few seconds.

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

(This used to be ctdb commit 7895bc003f087ab2f3181df3c464386f59bfcc39)
2012-10-18 20:05:42 +11:00
Martin Schwenke
f3ae31e741 Eventscripts: split 50.samba into 49.winbind and 50.samba
winbind and samba can be separately managed.  This makes the service
starting and stopping code way too complicated, and even adds a small
amount of complexity to the monitoring code.  The sensible option is
to split this eventscript in two.

There are two potentially backward incompatible changes here:

* Functionality has been removed that allowed 50.samba to manage
  winbind when CTDB_MANAGES_WINBIND was unset but the smb.conf
  "security" parameter was set to "ADS" or "DOMAIN".

  Maintaining this functionality would have required moving the
  testparm-related code to the functions file, deciding where the
  cache file should go, and then calling it from both 49.winbind and
  50.samba.  This feature wasn't of great value and asking
  administrators to set an extra variable in exchange for code
  simplicity seems like a reasonable deal.

* External code will need to be changed if it calls 50.samba directly
  with winbind-related expectations.  This is fairly obvious!

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

(This used to be ctdb commit 34535ae64420926b9a3bf7d453fed4e6f4c90115)
2012-10-03 08:46:32 +10:00
Ronnie Sahlberg
f84545726f GANESHA: make the ganesha script executable by default
(This used to be ctdb commit f59b40b3f8ea3da8ffb8601bc025e83c237072d5)
2012-05-17 11:16:57 +10:00
Ronnie Sahlberg
dce5969d12 Debug: When scripts hang, we may need to collect additional data in order to debug why the script hung.
Break this debug and datacollection out into an external script to make it easier to modify what data we need to collect.
For now we only collect a pstree so we can see what part of the script we hung in.

S1037271

(This used to be ctdb commit 6e68797af67bee36f2bad045f94806e7e98f27e9)
2012-05-17 10:29:03 +10:00
Martin Schwenke
64d90c0795 tests: Restore the old behaviour of "make test" so it uses tests/var
This is finally possible, given all the other changes...  :-)

This is a good default because daemons will be left running, test/var
will still exist and test failures can be investigated.

To "automatically" clean up, do:

  ./tests/run_tests.sh -C -V tests/var -- tests/simple/99_daemons_shutdown.sh

... although "killall ctdbd ; rm -rf tests/var" is less keystrokes.  ;-)

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

(This used to be ctdb commit d661f09c6c76543bd091d51bc0e6fe97ed0f55d1)
2012-05-14 15:02:19 +10:00
Ronnie Sahlberg
a57eba2bb4 Track all child process so we never send a signal to an unrelated process (our child died and kernel wrapped the pid-space and reused the pid for a different process
Wrap all creation of child processes inside ctdb_fork() which is used to track all processes we have spawned.
Capture SIGCHLD to track also which child processes have terminated.

Wrap kill() inside ctdb_kill() and make sure that we never send a !0 signal to a child process pid that has already terminated (and might have been replaced with a

(This used to be ctdb commit f73a4b1495830bcdd094a93732a89dd53b3c2f78)
2012-05-03 14:03:26 +10:00
Martin Schwenke
dc2dfbdb93 tests: Add installation script for tests
This could all be done in Makefile.in, but that would be very complex.

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

(This used to be ctdb commit 12c9986059cacda819e669fa77d613b408c62599)
2012-04-27 15:42:42 +10:00
Amitay Isaacs
dbe7fa9ff0 tests: Add a script to run cluster tests and make target "test_cluster"
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 420a10be89c62b4d605f3b972d78fd69dd9f5bb1)
2012-04-13 14:51:13 +10:00
Amitay Isaacs
d2be927389 build: Substitute POPT macros once and reuse variables
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a2ba2c4ec153c8844cf7f5b0de03b2269ec892f3)
2012-03-30 12:33:28 +11:00
Amitay Isaacs
634bbc5469 build: Use system tdb library if available
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 10ab88a5c822ac403a70a9cd1a6c81020eb91d08)
2012-03-30 12:33:28 +11:00
Amitay Isaacs
13124e356e build: Use system tevent library if available
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 2ade83de4e1f318c91489ec9a7f90d1b26f77e1b)
2012-03-30 12:33:28 +11:00
Amitay Isaacs
89415a1f00 build: Use system talloc library if available
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 94f1e02406c353c3a0235685acdd107ee5a7f285)
2012-03-30 12:33:27 +11:00
Amitay Isaacs
25d01ece07 build: Display correct LIB_FLAGS while building
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 0cbe7a4f92795203f022252a50a240b8bd4238c3)
2012-03-30 12:33:27 +11:00
Amitay Isaacs
da7a1ccb81 build: Add rules to create ctags/etags
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a9e9444a7a78f5ef0e929a8dbd8ca0c68b40acd4)
2012-03-30 12:32:05 +11:00
Martin Schwenke
56d90e930d Eventscript support - Remove unused interface_modify.sh
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 994492f79275fe84155d842f6bc288c1858217dd)
2012-03-22 15:30:27 +11:00
Ronnie Sahlberg
f7b2adfde6 Test: add test tool and test that UPDATE_RECORD works on persistent databases
(This used to be ctdb commit f06634951331232cddf0b48eac3552b92aca5b93)
2012-03-12 16:10:09 +11:00
Michael Adam
55abb07f51 server: move the code for the update_record control to its own file
It is very misleading in ctdb_persistent.c, since it is used for non-persistent
dbs...

(This used to be ctdb commit a956fa3a27106d0154a3fb46987d61c0a6b7c768)
2012-02-21 17:54:17 +01:00
Volker Lendecke
3d71e9f7f0 Add common/system_freebsd.c
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 89067e12b868974f9909b447ab5e202d612ac44f)
2012-02-13 16:32:35 +01:00
Mathieu Parent
938bb15ad9 Load platform dependent objs instead of Linux one
This fix compilation on Gnu/Hurd and kFreeBSD

See also:
https://buildd.debian.org/status/fetch.php?pkg=ctdb&arch=hurd-i386&ver=1.12%2Bgit20120201-1&stamp=1328211119
https://buildd.debian.org/status/fetch.php?pkg=ctdb&arch=kfreebsd-amd64&ver=1.12%2Bgit20120201-1&stamp=1328214761
https://buildd.debian.org/status/fetch.php?pkg=ctdb&arch=kfreebsd-i386&ver=1.12%2Bgit20120201-1&stamp=1328215875

(This used to be ctdb commit 496e8f8540f78606ef23ee8fa100eb2b2cf3f106)
2012-02-11 11:15:06 +11:00
Martin Schwenke
31487f31df Tests - add a version of the ctdb tool that compiles against libctdb stubs
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6c79b951c3ae68238f8dbd836ceca6c1187eaabe)
2012-02-06 16:00:24 +11:00
Martin Schwenke
97863216ed Tests - update test code for ctdb tool code and libctdb stubs
Rename ctdb_parse_nodestring.c to ctdb_tool_libctdb.c.  It can contain
many tests.

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

(This used to be ctdb commit d597020af01dfcdf0d39e1cf579bf33f43f87dda)
2012-02-06 16:00:23 +11:00
Martin Schwenke
af7611e4e0 Tests - test code for parse_nodestring() function
This function is fairly complex so here is some test code.

This reworks Makefile a bit and also provides test stubs for some
libctdb functions.

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

(This used to be ctdb commit 5b11f990404c26c279c9ae389483e560f1c01a81)
2011-12-08 17:21:24 +11:00
Michael Adam
a46e1d9d2c build: add target libctdb.so.0 and symlink libctdb.so
(This used to be ctdb commit 66af6659eaffaeafbfa58779162aabe915d1c50f)
2011-11-26 00:34:56 +01:00
Michael Adam
0f0250c2d0 build: add socket_wrapper objects to test binaries
(This used to be ctdb commit 7d4809ba343114e435830c7c1ab047dc4ce5ff0e)
2011-11-26 00:34:55 +01:00
Michael Adam
0ad39b733a build: add option --enable-socket-wrapper to build binaries with socket wrapper support
(This used to be ctdb commit 8d65d7f399ba2e6a4162eed5e84a58c7cb024187)
2011-11-26 00:34:55 +01:00
Martin Schwenke
bbe7cfd28f Tests: change ctdb_takeover_tests.c to include ctdbd code
Do this instead of linking to it.  This means that, after previous
cleanups, we can fix ctdb_takeover.c to use static functions when
appropriate and simply include all the code we need to run tests.

To make this reusable in other tests, new file ctdbd_tests.c does all
of the relevant including.  ctdb_takeover_tests.c just includes that
file.

Test objects built in this way can depend on new Makefile macro
$(CTDB_TEST_C), which contains ctdbd_tests.c and everything it
includes.

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

(This used to be ctdb commit 41869d42194b74db43a176a068e96e411007e5f2)
2011-11-11 14:31:50 +11:00
Martin Schwenke
bbea7ffdd0 Clean up warnings: rpcgen output contains unused variable.
Grep it out in the Makefile.  This should be very obvious if the
output changes and the grep breaks something.

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

(This used to be ctdb commit 79638bdd884caaf899c1b41984a5f0cf638207b5)
2011-11-11 14:29:36 +11:00
Martin Schwenke
aa3e368d3c Clean up warnings: add -Wno-format-zero-length to CFLAGS
There's an empty string passed to ctdb_event_script_callback() for
eventscript option arguments in ctdb_start_daemon() and this generates
a warning.

This type of warning seems pointless so let's switch it off.

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

(This used to be ctdb commit 23c164926c5ec4da6d90a5bdcbf2d0100729b451)
2011-11-10 14:10:21 +11:00
Martin Schwenke
59b4d7bf9d Clean up warnings: ‘tevent_loop_allow_nesting’ is deprecated
CTDB wants to use these functions but Samba's tevent wants to mark
them deprecated.  This adds a #define to shut up the warnings and sets
it in CFLAGS.

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

(This used to be ctdb commit 788cdbddbc902a5b076d23473450065b551d274d)
2011-11-09 14:41:17 +11:00
Ronnie Sahlberg
263031c73a Tests: convert test tool for fetching a readonly lock to libctdb
(This used to be ctdb commit 18b6969dd1760521f839e5a928f1c7e9b3c34d4e)
2011-10-28 15:50:44 +11:00
Ronnie Sahlberg
0dc5584101 Merge branch 'master-readonly-records' into foo
Conflicts:

	Makefile.in
	tools/ctdb.c

(This used to be ctdb commit 0fedef0ffba4178126eee9544c5e2db52f5db893)
2011-09-12 09:34:34 +10:00
David Disseldorp
9699e5750d pmda: Initial ctdb pmda check-in
The CTDB Performance Metrics Domain Agent (PMDA) is compiled when
Performance Co-Pilot (PCP) header files are present.

The CTDB PMDA periodically requests runtime counters from ctdbd (similar
to ctdb statistics) and exports these values via PCP for capture and
charting etc.

(This used to be ctdb commit fe7f69d6fc37661c2f1caa11de4ed3a7940d0a2f)
2011-09-06 14:01:18 +02:00
Ronnie Sahlberg
faf6710cde tests:ctdb_fetch_lock_once we must link with @POPT_OBJ@ in case -lpopt is not available
(This used to be ctdb commit cdbc800a776f213cfd0ed543cee85b0d1714a186)
2011-09-02 13:31:41 +10:00
Ronnie Sahlberg
8c3489430e tests: Link ctdb_fetch_lock_once with @TDB_OBJ@ not -ltdb so we dont create an unneeded dependency on having a standalone tdb library installed
(This used to be ctdb commit 9118b9cf1634866266fbf0a9bf857a622f994a1a)
2011-09-02 13:21:33 +10:00