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

261 Commits

Author SHA1 Message Date
Amitay Isaacs
69324b61f0 ctdb-daemon: Add helper process to execute event scripts
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-01-16 12:11:37 +11:00
Michael Adam
0e8340229b ctdb:build: install the new manpages
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-12-09 10:35:26 +11:00
Martin Schwenke
240f80d02b ctdb:tests: New "autotest" Makefile.in target
This needs to run with socket wrapper and needs to stop after the 1st
error.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
2013-11-27 18:46:17 +01:00
Amitay Isaacs
a5c4794048 packaging: Create runtime directories for CTDB
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c7450f9e22133333bf82c88a17ac25990ebc77ab)
2013-10-25 12:06:07 +11:00
Amitay Isaacs
4432aef6d1 packaging: Move ctdb/ directory from /var to /var/lib
Introduce CTDB_VARDIR variable that points to /var/lib/ctdb by default.
This makes CTDB_VARDIR consistent across C code and scripts.

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

(This used to be ctdb commit 2c09aac71188f43cd592572b10ea30b7a2969678)
2013-10-25 12:06:07 +11:00
Mathieu Parent
0e80ca24f3 Add missing events.d/99.timeout
(This used to be ctdb commit 1f6cc8764e28058c56d0350147032b6e30cb355d)
2013-10-24 16:54:07 +11:00
Martin Schwenke
24fb430d6e tests/tool: Remove references in libctdb in file and function names
Main changes are:

  libctdb_test.c -> ctdb_test_stubs.c
  ctdb_tool_libctdb.c -> ctdb_functest.c

ctdb_tool_stubby.c is gone, replaced with existing ctdb_test.c.

Functions starting with "libctdb_test_" now start with
"ctdb_test_stubs_".

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

(This used to be ctdb commit 6182bd0c19f215a997efe5272e633b1b1bd0c882)
2013-10-04 15:15:35 +10:00
Amitay Isaacs
7a8337a01d libctdb: Remove incomplete libctdb
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c5a7f2b4ff011e1393c4ff34864f85e6b472ff07)
2013-10-04 15:15:35 +10:00
Amitay Isaacs
d4643abe88 tests: Do not use libctdb code in tests
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ae0d8f432ef98a72c85a6cd42c503b718bef0e4e)
2013-10-04 15:15:34 +10:00
Amitay Isaacs
03379e332c tools/ctdb: Do not use libctdb for commandline tool
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit cd66282c635cf53386d8970b89c895076ea21cbd)
2013-10-04 15:15:34 +10:00
Amitay Isaacs
2814c9a0c5 tests: Remove unused test program ctdb_fetch_lock_once
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 873b9cadbcc363a9e5f450b0a1feb1cf2ce1e6c9)
2013-10-04 15:15:34 +10:00
Amitay Isaacs
7531b9528f build: Fix build dependencies for ctdb_lock_tdb
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit eb8575718400c45626cd1b2e0fd247bc3ebff655)
2013-08-22 17:59:59 +10:00
Amitay Isaacs
1d9d1d8cf9 tests: Add a test program to hold a lock on a database
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit f6b066a23610fb0092298861c21a9b354b91e2f1)
2013-08-01 11:08:26 +10:00
Amitay Isaacs
5f0b19c6f7 packaging: Bundle debug_locks.sh script in RPM
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 5740155cc5de1a223412e8529aa1a383a5412514)
2013-07-16 12:59:50 +10:00
Amitay Isaacs
bf2b388837 packaging: No need to check for existence of scripts, they always do
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 67c227a5d30cb8487b20b19b20bdfa4613906609)
2013-07-16 12:59:47 +10:00
Martin Schwenke
af0f11a4ab build: Turn off all deprecation warnings
The "‘tevent_loop_allow_nesting’ is deprecated" warnings will be
around for a while and are annoying.

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

(This used to be ctdb commit 30a0040fbb7c4d97d107f0e55c600295c2603a68)
2013-07-10 18:14:32 +10:00
Martin Schwenke
4349cb9807 build: Remove -DTEVENT_DEPRECATED_QUIET=1 from CFLAGS
This reverts the last part of 788cdbddbc902a5b076d23473450065b551d274d
- the rest of this has been implicitly reverted via tevent syncs.
This is just leftover noise.

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

(This used to be ctdb commit b6bbfb4c464c39e322830cbbebcc51c225508584)
2013-07-10 18:14:32 +10:00
Martin Schwenke
adbee6ae4e initscript: Simpify initscript and control CTDB via new ctdbd_wrapper
Currently the initscript is very complex.  This makes it hard to read
and hard to add support for new init systems, such as systemd.

Create a wrapper called ctdbd_wrapper to be installed alongside ctdbd.
This is called by the initscript to start and stop ctdbd.  It does the
ctdbd option construct and waits until ctdbd is properly initialised
before it exits.

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

(This used to be ctdb commit e3abc7eebab5cceddc4ce7817890dd5db9be3450)
2013-07-10 15:19:27 +10:00
Amitay Isaacs
71930e12b5 packaging: Install README.notify.d using %doc directive
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 53d34eb2f9e5434dea4e7182b6af566a3a96a368)
2013-07-04 16:49:15 +10:00
Amitay Isaacs
4a7f01f37e packaging: Install docs using %doc directive
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6fe584d05543eebd24abd19bab502dc4da04e921)
2013-07-04 16:49:06 +10:00
Amitay Isaacs
4a9ed315c7 build: Enable VERBOSE option to display build command line
make V=1 or make VERBOSE=1 will display build commands.

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

(This used to be ctdb commit 02c63c591cc273122b3a547bb301b92f0e4bd217)
2013-06-14 16:45:27 +10:00
Amitay Isaacs
8f2806fdbf build: Fix extra whitespaces
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 78cff9d54f241fb6a2943e50346f9c2ad9decc78)
2013-05-29 17:47:16 +10:00
Amitay Isaacs
7c5252e453 build: Use REPLACE_OBJ and CTDB_EXTERNAL_OBJ to simplify build rules
This fixes the build on AIX where libreplace is required to build
ctdb_lock_helper, ctdb_fetch_lock_once, ctdb_fetch_readonly_once.

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

(This used to be ctdb commit fa757b49374e44c2380d4457e9b0eb3582981fac)
2013-05-29 16:23:49 +10:00
Amitay Isaacs
93ac364e23 build: Support for building on AIX xlc compiler
xlc does not support -fPIC, -Wno-format-zero-length

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

(This used to be ctdb commit 2cf95741fdab2ee5f724950a0b1ef257d6aeade7)
2013-05-29 15:17:45 +10:00
Martin Schwenke
982ea336db build: Fix install paths for pcp pmda
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 11af486754bb04899e3dc544157bf70530e66cd1)
2013-05-28 14:24:16 +10:00
Amitay Isaacs
ae25420e56 locking: Use separate locking helper binary for locking
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 7cde53a6cbe74b1e46f7e1bca298df82c08de866)
2013-05-24 09:06:40 +10:00
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