mirror of
https://github.com/unraid/webgui.git
synced 2026-01-04 08:29:51 -06:00
Fix: when stopping Samba, terminate master smbd process first
This commit is contained in:
@@ -155,12 +155,17 @@ samba_stop(){
|
||||
REPLY="Already stopped"
|
||||
else
|
||||
REPLY="Stopped"
|
||||
# stop gracefully with SIGTERM the "master" smbd process first
|
||||
master=$(ps -o pid=,ppid= -C smbd | awk '$2==1 {print $1}')
|
||||
[[ -n "master" ]] && run kill "$master"
|
||||
sleep 1
|
||||
# stop gracefully with SIGTERM
|
||||
run killall --ns $$ smbd nmbd wsdd2 winbindd
|
||||
samba_waitfor_shutdown
|
||||
if samba_running; then
|
||||
REPLY="Killed"
|
||||
# stop forcibly with SIGKILL
|
||||
[[ -n "master" ]] && run kill -SIGKILL "master"
|
||||
run killall --ns $$ -SIGKILL smbd nmbd wsdd2 winbindd
|
||||
samba_waitfor_shutdown
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user