[137441] trunk/dports/net/asterisk/Portfile
jmr at macports.org
jmr at macports.org
Thu Jun 11 11:44:41 PDT 2015
Revision: 137441
https://trac.macports.org/changeset/137441
Author: jmr at macports.org
Date: 2015-06-11 11:44:41 -0700 (Thu, 11 Jun 2015)
Log Message:
-----------
asterisk: create and run as an asterisk user instead of running as root (#27492)
Modified Paths:
--------------
trunk/dports/net/asterisk/Portfile
Modified: trunk/dports/net/asterisk/Portfile
===================================================================
--- trunk/dports/net/asterisk/Portfile 2015-06-11 17:18:30 UTC (rev 137440)
+++ trunk/dports/net/asterisk/Portfile 2015-06-11 18:44:41 UTC (rev 137441)
@@ -5,6 +5,7 @@
name asterisk
version 1.6.2.20
+revision 1
categories net
platforms darwin
universal_variant no
@@ -40,9 +41,15 @@
checksums rmd160 8584d0f2e274517ce84576dfa7e936b9befb9fe2 \
sha256 4f3ef1de4644195e0d91816d6741c46ddb5d9ad28b07e631f594674ac9006a27
+add_users asterisk group=asterisk realname=Asterisk\ PBX
+
startupitem.create yes
startupitem.netchange yes
-startupitem.executable ${prefix}/sbin/asterisk -d
+if {[getuid] == 0} {
+ startupitem.executable ${prefix}/sbin/asterisk -d -U asterisk -G asterisk
+} else {
+ startupitem.executable ${prefix}/sbin/asterisk -d
+}
patchfiles makeopts.in.diff \
menuselect_Makefile.diff
@@ -77,4 +84,7 @@
xinstall -d ${destroot}${prefix}/var/log/asterisk \
${destroot}${prefix}/var/run/asterisk \
${destroot}${prefix}/var/spool/asterisk/outgoing
+ if {[getuid] == 0} {
+ system "chown -R asterisk:asterisk ${destroot}${prefix}/var/log/asterisk ${destroot}${prefix}/var/run/asterisk ${destroot}${prefix}/var/spool/asterisk"
+ }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150611/1a067c5b/attachment.html>
More information about the macports-changes
mailing list