diff options
author | Martin Schwenke <martin@meltin.net> | 2018-10-18 18:02:13 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2018-11-06 10:30:14 +0100 |
commit | 6e16e95f74c06bf381db666007a30ecb0e1ff7ce (patch) | |
tree | 20f2204fab5eee358d5595775539a868cc4a054d /ctdb | |
parent | 01f6fbba4e5823f2cc028ba6f094b55812dff6ee (diff) | |
download | samba-6e16e95f74c06bf381db666007a30ecb0e1ff7ce.tar.gz |
ctdb-daemon: Do not fork when CTDB_TEST_MODE is set
Explicitly background ctdbd instead.
This has the advantage of leaving stdin open. ctdbd can then be
enhanced to exit when stdin closes, allowing better cleanup in a test
environment.
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): Tue Nov 6 10:30:14 CET 2018 on sn-devel-144
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/server/ctdbd.c | 3 | ||||
-rwxr-xr-x | ctdb/tests/local_daemons.sh | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c index ebe111ddde6..a2870d0d111 100644 --- a/ctdb/server/ctdbd.c +++ b/ctdb/server/ctdbd.c @@ -374,6 +374,9 @@ int main(int argc, const char *argv[]) fast_start = true; } + /* Don't fork when running in test mode */ + interactive = interactive || test_mode != NULL; + /* start the protocol running (as a child) */ return ctdb_start_daemon(ctdb, !interactive); diff --git a/ctdb/tests/local_daemons.sh b/ctdb/tests/local_daemons.sh index 6f6d03ffa08..9329a60643c 100755 --- a/ctdb/tests/local_daemons.sh +++ b/ctdb/tests/local_daemons.sh @@ -334,7 +334,7 @@ local_daemons_start () onnode_common - onnode "$_nodes" "${VALGRIND:-} ctdbd" + onnode "$_nodes" "${VALGRIND:-} ctdbd &" } local_daemons_stop () |