The branch, master has been updated via 1d2d0c3 ctdb-scripts: Strengthen check to see if ctdbd is running via fd8e562 ctdb-packaging: Move CTDB tests to /usr/local/share/ctdb/tests/ from 3aebe9e smbd: Fix a comment
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 1d2d0c34fc6e7d217f322adb6b6d3e920cbedf89 Author: Martin Schwenke <mar...@meltin.net> Date: Mon Oct 10 14:56:18 2016 +1100 ctdb-scripts: Strengthen check to see if ctdbd is running Don't just rely on the process existing. It must be called "ctdbd". Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> Autobuild-User(master): Amitay Isaacs <ami...@samba.org> Autobuild-Date(master): Fri Oct 14 11:54:40 CEST 2016 on sn-devel-144 commit fd8e562069e3c01720be62069b7d58d14c10afd5 Author: Martin Schwenke <mar...@meltin.net> Date: Tue Oct 11 11:30:37 2016 +1100 ctdb-packaging: Move CTDB tests to /usr/local/share/ctdb/tests/ In time, other things will end up in /use/local/share/ctdb/. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12104 Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> ----------------------------------------------------------------------- Summary of changes: ctdb/config/ctdbd_wrapper | 14 +++++++++----- ctdb/packaging/RPM/ctdb.spec.in | 4 ++-- ctdb/wscript | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper index 11ea59a..8a9f554 100755 --- a/ctdb/config/ctdbd_wrapper +++ b/ctdb/config/ctdbd_wrapper @@ -31,17 +31,21 @@ ctdbd="${CTDBD:-/usr/local/sbin/ctdbd}" # ctdbd_is_running() # Check if ctdbd is running. ctdbd is only considered to running if -# the PID in the PID file is active. Return true if this is the case. -# Print the PID regardless, since it can be used to kill stale -# processes in the session. +# the PID in the PID file is active and is called "ctdbd". Return +# true if this is the case. Print the PID regardless, since it can be +# used to kill stale processes in the session. ctdbd_is_running () { if read _pid 2>/dev/null <"$pidfile" ; then echo "$_pid" - # Return value of kill is used - kill -0 "$_pid" 2>/dev/null + # This could be optimised with ps options -q and -h. + # However, -q is not generally available because it is + # fairly new and -h is not in some older distros. The + # options below are portable. + _cmd=$(ps -p "$_pid" -o comm | tail -n +2) + [ "$_cmd" = "ctdbd" ] else # Missing/empty PID file return 1 diff --git a/ctdb/packaging/RPM/ctdb.spec.in b/ctdb/packaging/RPM/ctdb.spec.in index ea97d8e..aae2c7e 100644 --- a/ctdb/packaging/RPM/ctdb.spec.in +++ b/ctdb/packaging/RPM/ctdb.spec.in @@ -257,8 +257,8 @@ test suite for ctdb %files tests %defattr(-,root,root) -%dir %{_datadir}/%{name}-tests -%{_datadir}/%{name}-tests/* +%dir %{_datadir}/%{name}/tests +%{_datadir}/%{name}/tests/* %dir %{_libexecdir}/%{name}/tests %{_libexecdir}/%{name}/tests/* %{_bindir}/ctdb_run_tests diff --git a/ctdb/wscript b/ctdb/wscript index 5675849..c775cb5 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -209,7 +209,7 @@ def configure(conf): conf.env.CTDB_RUNDIR)) conf.env.CTDB_TEST_DATADIR = os.path.join(conf.env.EXEC_PREFIX, - 'share/ctdb-tests') + 'share/ctdb/tests') conf.env.CTDB_TEST_LIBEXECDIR = os.path.join(conf.env.LIBEXECDIR, 'ctdb/tests') # Allow unified compilation and separate compilation of utilities -- Samba Shared Repository