aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorfjoe <fjoe@FreeBSD.org>2010-11-08 02:08:37 +0800
committerfjoe <fjoe@FreeBSD.org>2010-11-08 02:08:37 +0800
commitd7b8d7c393b46ac57a40957462883f501d3a6901 (patch)
treeb37c0438af1d9c1efd5971f4d09805b87afccc0b /net
parentca6c2149835087cbfb08c9fcf767d565171cb523 (diff)
downloadfreebsd-ports-gnome-d7b8d7c393b46ac57a40957462883f501d3a6901.tar.gz
freebsd-ports-gnome-d7b8d7c393b46ac57a40957462883f501d3a6901.tar.zst
freebsd-ports-gnome-d7b8d7c393b46ac57a40957462883f501d3a6901.zip
Run asterisk under non-root user (asterisk).
Submitted by: MAINTAINER
Diffstat (limited to 'net')
-rw-r--r--net/asterisk16/Makefile12
-rw-r--r--net/asterisk16/files/asterisk.sh.in3
-rw-r--r--net/asterisk16/pkg-plist2
3 files changed, 15 insertions, 2 deletions
diff --git a/net/asterisk16/Makefile b/net/asterisk16/Makefile
index 05d3b70e0dbf..4003690f2e65 100644
--- a/net/asterisk16/Makefile
+++ b/net/asterisk16/Makefile
@@ -7,6 +7,7 @@
PORTNAME= asterisk
PORTVERSION= 1.6.2.13
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://downloads.asterisk.org/pub/telephony/asterisk/ \
http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/
@@ -57,6 +58,12 @@ OPTIONS= OGGVORBIS "Enable Ogg Vorbis support" on \
ILBC "Enable iLBC codec" off \
SPANDSP "Enable Spandsp faxing support" off
+ASTERISK_USER?= asterisk
+ASTERISK_GROUP?= asterisk
+
+USERS= ${ASTERISK_USER}
+GROUPS= ${ASTERISK_GROUP} dahdi
+
.include <bsd.port.pre.mk>
.if ${ARCH} == "i386" || ${ARCH} == "amd64"
@@ -66,6 +73,8 @@ OPTIONS+= DAHDI "Enable DAHDI support" on
.include <bsd.port.options.mk>
.endif
+SUB_LIST+= ASTERISK_USER=${ASTERISK_USER}
+
.if !defined(WITH_H323)
PLIST_SUB+= WITH_H323="@comment "
CONFIGURE_ARGS+= --without-h323
@@ -219,4 +228,7 @@ post-extract:
post-patch:
${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample
+post-install:
+ @${CHOWN} -R ${ASTERISK_USER}:${ASTERISK_GROUP} /var/db/asterisk /var/log/asterisk /var/spool/asterisk
+
.include <bsd.port.post.mk>
diff --git a/net/asterisk16/files/asterisk.sh.in b/net/asterisk16/files/asterisk.sh.in
index a8cbb1f1eadf..d4b1330e3271 100644
--- a/net/asterisk16/files/asterisk.sh.in
+++ b/net/asterisk16/files/asterisk.sh.in
@@ -14,7 +14,7 @@
stop_cmd=asterisk_shutdown
asterisk_shutdown () {
echo 'Stopping asterisk'
- %%PREFIX%%/sbin/asterisk -qrx 'core stop now'
+ %%PREFIX%%/sbin/asterisk -nqrx 'core stop now'
sleep 1
return 0
}
@@ -23,6 +23,7 @@ name=asterisk
rcvar=`set_rcvar`
command=%%PREFIX%%/sbin/asterisk
+command_args="-n -U %%ASTERISK_USER%%"
load_rc_config $name
diff --git a/net/asterisk16/pkg-plist b/net/asterisk16/pkg-plist
index d44913a5d804..6e0e82504c01 100644
--- a/net/asterisk16/pkg-plist
+++ b/net/asterisk16/pkg-plist
@@ -386,7 +386,7 @@ lib/asterisk/modules/res_ael_share.so
lib/asterisk/modules/res_clialiases.so
%%WITH_CURL%%lib/asterisk/modules/res_curl.so
%%WITH_CURL%%lib/asterisk/modules/res_config_curl.so
-lib/asterisk/modules/res_config_ldap.so
+%%WITH_H323%%lib/asterisk/modules/res_config_ldap.so
%%WITH_SQLITE%%lib/asterisk/modules/res_config_sqlite.so
lib/asterisk/modules/res_limit.so
lib/asterisk/modules/res_phoneprov.so