[SCM] Samba Shared Repository - branch master updated
Amitay Isaacs
amitay at samba.org
Mon Oct 10 10:55:02 UTC 2016
The branch, master has been updated
via 72e415b ctdb-scripts: Dump stack traces of smbd processes after shutdown
from b3d938c s3-sysquotas: correctly restore path when finding mount point
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 72e415be4cdb39ba3443adf9a4a441b5474868fe
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Oct 6 11:14:09 2016 +1100
ctdb-scripts: Dump stack traces of smbd processes after shutdown
If any processes remain then they may be stuck in D state and this
might tell us why.
Update tests: tweak pidof stub, add support for smbd stack traces and
add some new tests for the shutdown event.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Mon Oct 10 12:54:24 CEST 2016 on sn-devel-144
-----------------------------------------------------------------------
Summary of changes:
ctdb/config/events.d/50.samba | 1 +
...mba.monitor.101.sh => 50.samba.shutdown.001.sh} | 7 +++--
ctdb/tests/eventscripts/50.samba.shutdown.002.sh | 15 ++++++++++
ctdb/tests/eventscripts/scripts/local.sh | 33 +++++++++++++++++++---
ctdb/tests/eventscripts/stubs/pidof | 7 +++--
5 files changed, 54 insertions(+), 9 deletions(-)
copy ctdb/tests/eventscripts/{50.samba.monitor.101.sh => 50.samba.shutdown.001.sh} (53%)
create mode 100755 ctdb/tests/eventscripts/50.samba.shutdown.002.sh
Changeset truncated at 500 lines:
diff --git a/ctdb/config/events.d/50.samba b/ctdb/config/events.d/50.samba
index b521d00..4ed892c 100755
--- a/ctdb/config/events.d/50.samba
+++ b/ctdb/config/events.d/50.samba
@@ -65,6 +65,7 @@ service_start ()
service_stop ()
{
service "$CTDB_SERVICE_SMB" stop
+ program_stack_traces "smbd" 5
if [ -n "$CTDB_SERVICE_NMB" ] ; then
service "$CTDB_SERVICE_NMB" stop
fi
diff --git a/ctdb/tests/eventscripts/50.samba.monitor.101.sh b/ctdb/tests/eventscripts/50.samba.shutdown.001.sh
similarity index 53%
copy from ctdb/tests/eventscripts/50.samba.monitor.101.sh
copy to ctdb/tests/eventscripts/50.samba.shutdown.001.sh
index cf3b53a..8c0be7c 100755
--- a/ctdb/tests/eventscripts/50.samba.monitor.101.sh
+++ b/ctdb/tests/eventscripts/50.samba.shutdown.001.sh
@@ -2,10 +2,11 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
-define_test "all OK"
+define_test "shutdown, simple"
setup_samba
-ok_null
-
+ok <<EOF
+Stopping smb: OK
+EOF
simple_test
diff --git a/ctdb/tests/eventscripts/50.samba.shutdown.002.sh b/ctdb/tests/eventscripts/50.samba.shutdown.002.sh
new file mode 100755
index 0000000..7ead53c
--- /dev/null
+++ b/ctdb/tests/eventscripts/50.samba.shutdown.002.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "shutdown, simple"
+
+setup_samba
+
+samba_setup_fake_threads 1 2 3 4 5 6
+
+ok <<EOF
+Stopping smb: OK
+$SAMBA_STACK_TRACES
+EOF
+simple_test
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh
index 61a033a..ea900eb 100644
--- a/ctdb/tests/eventscripts/scripts/local.sh
+++ b/ctdb/tests/eventscripts/scripts/local.sh
@@ -839,6 +839,23 @@ setup_samba ()
fi
}
+samba_setup_fake_threads ()
+{
+ export FAKE_SMBD_THREAD_PIDS="$*"
+
+ _nl="
+"
+ _out=""
+ _count=0
+ for _pid ; do
+ [ "$_count" -lt 5 ] || break
+ _t=$(program_stack_trace "smbd" $_pid)
+ _out="${_out:+${_out}${_nl}}${_t}"
+ _count=$((_count + 1))
+ done
+ SAMBA_STACK_TRACES="$_out"
+}
+
setup_winbind ()
{
setup_ctdb
@@ -999,6 +1016,17 @@ nfs_setup_fake_threads ()
esac
}
+program_stack_trace ()
+{
+ _prog="$1"
+ _pid="$2"
+
+ cat <<EOF
+Stack trace for ${_prog}[${_pid}]:
+[<ffffffff87654321>] fake_stack_trace_for_pid_${_pid}/stack+0x0/0xff
+EOF
+}
+
program_stack_traces ()
{
_prog="$1"
@@ -1008,10 +1036,7 @@ program_stack_traces ()
for _pid in ${FAKE_NFSD_THREAD_PIDS:-$FAKE_RPC_THREAD_PIDS} ; do
[ $_count -le $_max ] || break
- cat <<EOF
-Stack trace for ${_prog}[${_pid}]:
-[<ffffffff87654321>] fake_stack_trace_for_pid_${_pid}/stack+0x0/0xff
-EOF
+ program_stack_trace "$_prog" "$_pid"
_count=$(($_count + 1))
done
}
diff --git a/ctdb/tests/eventscripts/stubs/pidof b/ctdb/tests/eventscripts/stubs/pidof
index b84aef0..8b57923 100755
--- a/ctdb/tests/eventscripts/stubs/pidof
+++ b/ctdb/tests/eventscripts/stubs/pidof
@@ -1,12 +1,15 @@
#!/bin/sh
case "$1" in
- nfsd)
+nfsd)
echo "$FAKE_NFSD_THREAD_PIDS"
;;
- rpc.statd|rpc.rquotad|rpc.mountd)
+rpc.statd|rpc.rquotad|rpc.mountd)
echo "$FAKE_RPC_THREAD_PIDS"
;;
+smbd)
+ echo "$FAKE_SMBD_THREAD_PIDS"
+ ;;
*)
echo "pidof: \"$1\" not implemented"
exit 1
--
Samba Shared Repository
More information about the samba-cvs
mailing list