Date: Tue, 30 Nov 2010 14:03:38 GMT From: Alexander Brovikov <alexander@brovikov.ru> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/152703: [patch] net/asterisk add reload cmd to rc-script and correct path to pidfile Message-ID: <201011301403.oAUE3cfq068940@red.freebsd.org> Resent-Message-ID: <201011301410.oAUEAAQU078894@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 152703 >Category: ports >Synopsis: [patch] net/asterisk add reload cmd to rc-script and correct path to pidfile >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Nov 30 14:10:10 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Alexander Brovikov >Release: 8.1-RELEASE >Organization: >Environment: FreeBSD vbox 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: I suggest patch for net/asterisk rc.d script that: - adds 'reload' command; - corrects default path to pidfile (otherwise 'status' cmd don't work); - renames 'asterisk_shutdown' to 'asterisk_stop'; - does some clean-up. Is 'sleep 1' & 'return 0' lines in 'asterisk_stop' really needed? >How-To-Repeat: >Fix: Patch attached with submission follows: --- /usr/local/etc/rc.d/asterisk.orig 2010-11-30 13:36:29.000000000 +0500 +++ /usr/local/etc/rc.d/asterisk 2010-11-30 18:57:26.000000000 +0500 @@ -11,24 +11,32 @@ . /etc/rc.subr -stop_cmd=asterisk_shutdown -asterisk_shutdown () { - echo 'Stopping asterisk' - /usr/local/sbin/asterisk -nqrx 'core stop now' - sleep 1 - return 0 -} name=asterisk rcvar=`set_rcvar` +extra_commands="reload" +load_rc_config $name + +stop_cmd="asterisk_stop" +reload_cmd="asterisk_reload" + +asterisk_enable=${asterisk_enable:-"NO"} -command=/usr/local/sbin/asterisk +command="/usr/local/sbin/asterisk" command_args="-n -U asterisk" +pidfile=${asterisk_pidfile:-"/var/run/asterisk/asterisk.pid"} -load_rc_config $name -pidfile=${asterisk_pidfile:-"/var/run/asterisk.pid"} +asterisk_stop () { + echo 'Stopping asterisk' + $command -nqrx 'core stop now' + sleep 1 + return 0 +} -asterisk_enable=${asterisk_enable:-"NO"} +asterisk_reload () { + echo 'Reloading asterisk' + $command -nqrx 'reload' +} run_rc_command "$1" >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011301403.oAUE3cfq068940>