Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Mar 2021 08:53:11 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 254006] net/samba(all versions): rc.d/samba_server stop/restart patch for restart crash
Message-ID:  <bug-254006-7788-QHELlrt6Na@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-254006-7788@https.bugs.freebsd.org/bugzilla/>
References:  <bug-254006-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254006

--- Comment #1 from Peter Eriksson <pen@lysator.liu.se> ---
Comment on attachment 222968
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D222968
Patch to fix samba_server rc.d script to wait for all processes to die

>--- samba_server.orig	2021-03-04 09:38:24.177530000 +0100
>+++ samba_server	2021-03-04 09:37:48.721550000 +0100
>@@ -126,11 +126,27 @@
> 	rcvar=3D${name}_enable
> 	command=3D"/usr/local/sbin/${name}"
> 	pidfile=3D"${samba_server_piddir}/${name}.pid"
>+	masterpid=3D""
>+	if [ "${rc_arg}" =3D "stop" ] ; then
>+	    masterpid=3D"`cat ${pidfile}`"
>+	fi
>+=09
> 	# Daemon should be enabled and running
> 	if ( [ -n "${rcvar}" ] && checkyesno "${rcvar}" ) || [ -n "$force_run" ]=
; then
> 	    run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}
> 	    # If any of the commands failed, take it as a global result
> 	    result=3D$((${result} || $?))
>+
>+	    if [ "${rc_arg}" =3D "stop" -a "$masterpid" !=3D "" ] ; then
>+		if pgrep -q -s "$masterpid"; then
>+		    echo -n "Waiting for all ${name} subprocesses to terminate..."
>+		    while pgrep -q -s "$masterpid"; do
>+			echo -n "."
>+			sleep 1
>+		    done
>+		    echo ""
>+		fi
>+	    fi
> 	fi
>     done
>     return ${result}

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-254006-7788-QHELlrt6Na>