Univention Bugzilla – Attachment 11164 Details for
Bug 56914
Samba (AD DC) restart may fail due to network sockets still being occupied by left-over processes - NT_STATUS_ADDRESS_ALREADY_ASSOCIATED
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to /etc/init.d/samba-ad-dc
samba-ad-dc.patch (text/plain), 2.21 KB, created by
Christian Kowarzik
on 2023-12-14 14:18:41 CET
(
hide
)
Description:
patch to /etc/init.d/samba-ad-dc
Filename:
MIME Type:
Creator:
Christian Kowarzik
Created:
2023-12-14 14:18:41 CET
Size:
2.21 KB
patch
obsolete
>--- a/etc/init.d/samba-ad-dc 2023-07-17 11:16:30.000000000 +0200 >+++ b/etc/init.d/samba-ad-dc 2023-12-14 12:44:32.176000000 +0100 >@@ -77,30 +77,36 @@ > log_daemon_msg "Stopping $DESC" $NAME > ## sometimes samba takes a long time to terminate, > ## which would make starting new samba processes fail. >- start-stop-daemon --stop --quiet --pidfile $PIDFILE \ >- --name samba --retry 'TERM/15/KILL/1' -v \ >- | sed -rn 's/.*, (retry #|refused to die)/\1/p' \ >- | while read line; do log_action_cont_msg "$line"; done >- ret="$?" >- ## check for smbd and winbindd as well, in case ADDS has just been configured >- for service in smbd winbindd; do >- pid=$(pgrep -x "$service") >- if [ -n "$pid" ]; then >- start-stop-daemon --stop --quiet --oknodo \ >- --name "$service" --retry "TERM/3/KILL/1" -v \ >- | sed -rn 's/.*, (retry #|refused to die)/\1/p' \ >- | while read line; do log_action_cont_msg "$line"; done >+ pids="$(pgrep --exact samba$; pgrep --exact smbd$; pgrep --exact winbindd$)" >+ start-stop-daemon --stop --quiet --pidfile $PIDFILE --name samba >+ ret=0 >+ TERM_TIMEOUT=60 >+ KILL_TIMEOUT=10 >+ if [ -n "$pids" ]; then >+ unset pgids kgids >+ while read pid; do >+ pgids="$pgids -g $pid" >+ kgids="$kgids -${pid# }" >+ done <<-_EOF_ >+ $pids >+ _EOF_ >+ while [ $TERM_TIMEOUT -gt 0 ]; do >+ [ -z "$(ps -o pid= $pgids)" ] && break >+ sleep 1 >+ TERM_TIMEOUT=$((TERM_TIMEOUT-1)) >+ done >+ if [ $TERM_TIMEOUT -eq 0 ]; then >+ log_action_msg "Samba did not terminate in time. Killing remaining processes" >+ ps -Ho state,pid,pgrp,time,args $pgids \ >+ | while read line; do log_action_msg "$line"; done >+ kill -9 $kgids 2>/dev/null >+ while [ $KILL_TIMEOUT -gt 0 ]; do >+ [ -z "$(ps -o pid= $pgids)" ] && break >+ sleep 1 >+ KILL_TIMEOUT=$((KILL_TIMEOUT-1)) >+ done >+ [ $KILL_TIMEOUT -eq 0 ] && ret=1 > fi >- done >- ## Check again for /usr/sbin/samba >- pgrep_output="$(pgrep -f /usr/sbin/samba)" >- if [ -n "$pgrep_output" ]; then >- { >- echo -e "ERROR: Stuck process after service stop:\n$pgrep_output" >- echo "PIDFILE: $(<$PIDFILE)" >- samba-tool processes >- } | logger -p daemon.error -t SAMBA >- pkill -9 -f /usr/sbin/samba > fi > pkill samba-dcerpcd > pkill samba-bgqd
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 56914
:
11163
| 11164 |
11165