Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Dec 2006 15:45:47 -0700 (MST)
From:      Brad Huntting <huntting@glarp.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/107222: stoping problems with rc.d/asterisk-bristuf
Message-ID:  <200612262245.kBQMjl41002118@antediluvian.glarp.com>
Resent-Message-ID: <200612262330.kBQNUEZL056281@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         107222
>Category:       ports
>Synopsis:       stoping problems with rc.d/asterisk-bristuf
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 26 23:30:13 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Brad Huntting
>Release:        FreeBSD 6.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD antediluvian.glarp.com 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May 7 04:32:43 UTC 2006 root@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386


>Description:

	/usr/local/etc/rc.d/asterisk stop

	sometimes hangs, unable to kill the asterisk server.

>How-To-Repeat:
	/usr/local/etc/rc.d/asterisk stop

>Fix:

	This patch to the rc.d script send asterisk the 'stop now'
	command (and waits for it's return, prior to sending a
	SIGKILL).  This seems to work more reliably than simply
	sending a SIGTERM to the server.

	The same patch could (should?) be applied to the net/asterisk
	port as well as the net/asterisk-bristuff port.


diff -ur /usr/ports/net/asterisk-bristuff/files/asterisk.sh.in /tmp/asterisk-bristuff/files/asterisk.sh.in
--- /usr/ports/net/asterisk-bristuff/files/asterisk.sh.in	Wed Nov  8 04:26:59 2006
+++ /tmp/asterisk-bristuff/files/asterisk.sh.in	Tue Dec 26 15:39:51 2006
@@ -16,7 +16,15 @@
 rcvar=`set_rcvar`
 
 command=%%PREFIX%%/sbin/asterisk
+stop_precmd=asterisk_shutdown
+sig_stop=KILL
 
+asterisk_shutdown () {
+	/usr/local/sbin/asterisk -qrx 'stop now'
+	sleep 1
+	return 0
+}
+ 
 load_rc_config $name
 
 pidfile=${asterisk_pidfile:-"/var/run/asterisk.pid"}
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612262245.kBQMjl41002118>