diff options
author | Guido Falsi <madpilot@FreeBSD.org> | 2021-03-16 06:22:21 +0800 |
---|---|---|
committer | Guido Falsi <madpilot@FreeBSD.org> | 2021-03-16 06:22:21 +0800 |
commit | f3c3083ecd22e2f5f170e92c8bed215e9c33c303 (patch) | |
tree | 05a170514f1b0a0a97f40b8cc4d14ac72a10d47c /net | |
parent | a0e5328ef708ae0d4ebc5c683b7b08623f42ca0c (diff) | |
download | freebsd-ports-gnome-f3c3083ecd22e2f5f170e92c8bed215e9c33c303.tar.gz freebsd-ports-gnome-f3c3083ecd22e2f5f170e92c8bed215e9c33c303.tar.zst freebsd-ports-gnome-f3c3083ecd22e2f5f170e92c8bed215e9c33c303.zip |
- 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>
Diffstat (limited to 'net')
-rw-r--r-- | net/asterisk18/Makefile | 1 | ||||
-rw-r--r-- | net/asterisk18/files/asterisk.in | 27 |
2 files changed, 16 insertions, 12 deletions
diff --git a/net/asterisk18/Makefile b/net/asterisk18/Makefile index 6fc6c9efa875..86b7456c944d 100644 --- a/net/asterisk18/Makefile +++ b/net/asterisk18/Makefile @@ -2,6 +2,7 @@ PORTNAME= asterisk PORTVERSION= 18.2.2 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= https://downloads.asterisk.org/pub/telephony/%SUBDIR%/:DEFAULT,g729 MASTER_SITE_SUBDIR= asterisk/ \ diff --git a/net/asterisk18/files/asterisk.in b/net/asterisk18/files/asterisk.in index 80cfdb093737..535f91ec2c0c 100644 --- a/net/asterisk18/files/asterisk.in +++ b/net/asterisk18/files/asterisk.in @@ -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} @@ -72,15 +86,4 @@ asterisk_reload() $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" |