ctdb-scripts: Dump stack traces of smbd processes after shutdown
[samba.git] / ctdb / config / events.d / 50.samba
index b2a5fa460139dc4002bd0f1688cf604a3415cea2..4ed892cdc5905e3efaa45e9441109a59e781c2f7 100755 (executable)
@@ -30,7 +30,7 @@ service_name="samba"
 
 loadconfig
 
-ctdb_setup_service_state_dir
+service_state_dir=$(ctdb_setup_service_state_dir) || exit $?
 
 service_start ()
 {
@@ -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
@@ -172,6 +173,8 @@ monitor)
            smb_ports=$(list_samba_ports)
            [ -n "$smb_ports" ] || die "Failed to set smb ports"
        fi
+       # Intentionally unquoted multi-word value here
+       # shellcheck disable=SC2086
        ctdb_check_tcp_ports $smb_ports || exit $?
 
        if [ "$CTDB_SAMBA_SKIP_SHARE_CHECK" != "yes" ] ; then