File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -156,16 +156,16 @@ samba_stop(){
156156 else
157157 REPLY=" Stopped"
158158 # stop gracefully with SIGTERM the "master" smbd process first
159- master=$( ps -o pid=,ppid= -C smbd | awk ' $2==1 {print $1} ' )
160- [[ -n " master" ]] && run kill " $master "
159+ master=$( pgrep --ns $$ -o smbd )
160+ [[ -n " $ master" ]] && run kill " $master "
161161 sleep 1
162162 # stop gracefully with SIGTERM
163163 run killall --ns $$ smbd nmbd wsdd2 winbindd
164164 samba_waitfor_shutdown
165165 if samba_running; then
166166 REPLY=" Killed"
167167 # stop forcibly with SIGKILL
168- [[ -n " master" ]] && run kill -SIGKILL " master"
168+ [[ -n " $ master" ]] && run kill -SIGKILL " $ master"
169169 run killall --ns $$ -SIGKILL smbd nmbd wsdd2 winbindd
170170 samba_waitfor_shutdown
171171 fi
You can’t perform that action at this time.
0 commit comments