Date: Mon, 15 Mar 2021 22:21:54 +0000 (UTC) From: Guido Falsi <madpilot@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r568513 - in head/net/asterisk13: . files Message-ID: <202103152221.12FMLsQt017575@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: madpilot Date: Mon Mar 15 22:21:54 2021 New Revision: 568513 URL: https://svnweb.freebsd.org/changeset/ports/568513 Log: - Add variable to configure group owner for asterisk runtime directory creation in startup script - Correct order of variables PR: 254232 SUbmitted by: Boris Korzun <drtr0jan@yandex.ru> Modified: head/net/asterisk13/Makefile head/net/asterisk13/files/asterisk.in Modified: head/net/asterisk13/Makefile ============================================================================== --- head/net/asterisk13/Makefile Mon Mar 15 22:11:37 2021 (r568512) +++ head/net/asterisk13/Makefile Mon Mar 15 22:21:54 2021 (r568513) @@ -2,6 +2,7 @@ PORTNAME= asterisk PORTVERSION= 13.38.2 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= https://downloads.asterisk.org/pub/telephony/%SUBDIR%/:DEFAULT,g729 MASTER_SITE_SUBDIR= asterisk/ \ Modified: head/net/asterisk13/files/asterisk.in ============================================================================== --- head/net/asterisk13/files/asterisk.in Mon Mar 15 22:11:37 2021 (r568512) +++ head/net/asterisk13/files/asterisk.in Mon Mar 15 22:21:54 2021 (r568513) @@ -13,6 +13,8 @@ # Default is "NO" # asterisk_user (string): User asterisk runs as # Default is %%ASTERISK_USER%% +# asterisk_group (string): Group asterisk runs as +# Default is %%ASTERISK_GROUP%% # asterisk_args (string): Extra argumeents to pass to asterisk at startup # Default is "-n" # asterisk_pidfile (string): Location of the asterisk pid file @@ -28,19 +30,31 @@ name=asterisk rcvar=asterisk_enable desc="Asterisk PBX server" +load_rc_config $name + +: ${asterisk_enable:=NO} +: ${asterisk_user:=%%ASTERISK_USER%%} +: ${asterisk_group:=%%ASTERISK_GROUP%%} +: ${asterisk_args=-n} +: ${asterisk_pidfile:=/var/run/asterisk/asterisk.pid} +: ${asterisk_stopsleep:=0} + extra_commands=reload start_precmd=asterisk_precmd stop_cmd=asterisk_stop reload_cmd=asterisk_reload +pidfile="${asterisk_pidfile}" + command="%%PREFIX%%/sbin/asterisk" +command_args="${asterisk_args} -F -U ${asterisk_user}" asterisk_precmd() { local rundir=${asterisk_pidfile%/*} if [ ! -d $rundir ] ; then - install -d -m 0755 -o asterisk -g asterisk $rundir + install -d -m 0750 -o "${asterisk_user}" -g "${asterisk_group}" "$rundir" fi if [ -n "${asterisk_umask}" ]; then umask ${asterisk_umask} @@ -71,16 +85,5 @@ asterisk_reload() echo 'Reloading asterisk.' $command -nqrx 'reload' } - -load_rc_config $name - -: ${asterisk_enable:=NO} -: ${asterisk_user:=%%ASTERISK_USER%%} -: ${asterisk_args=-n} -: ${asterisk_pidfile:=/var/run/asterisk/asterisk.pid} -: ${asterisk_stopsleep:=0} - -command_args="${asterisk_args} -F -U ${asterisk_user}" -pidfile=${asterisk_pidfile} run_rc_command "$1"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103152221.12FMLsQt017575>