diff options
author | Matthew Jordan <mjordan@digium.com> | 2013-08-29 20:22:08 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2013-08-29 20:22:08 +0000 |
commit | 449afdd9e8d38a5a479cc0320091fd315d2b4d4a (patch) | |
tree | 939db846ed6eefac593e4cc8adde59e366663622 /contrib/scripts | |
parent | 417230848f177763d06d0d851253df17348fed79 (diff) |
Revert r394939 due to (numerous) objections
The patch from ASTERISK-21965 was committed perhaps a bit too hastily. Walter
and Tzafrir have pointed out numerous issues with the approach and have
propsed an alternative in r/2757. Since it's not a time critical issue and
is not worth holding up the release of 12 for it, I've gone ahead and reverted
r394939 from 12/trunk and re-opened ASTERISK-21965.
........
Merged revisions 397938 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'contrib/scripts')
-rw-r--r-- | contrib/scripts/safe_asterisk | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/contrib/scripts/safe_asterisk b/contrib/scripts/safe_asterisk index 822e1c8cd..2e661b476 100644 --- a/contrib/scripts/safe_asterisk +++ b/contrib/scripts/safe_asterisk @@ -1,7 +1,6 @@ #!/bin/sh # vim:textwidth=80:tabstop=4:shiftwidth=4:smartindent:autoindent -ASTETCDIR=__ASTERISK_ETC_DIR__ ASTSBINDIR=__ASTERISK_SBIN_DIR__ ASTVARRUNDIR=__ASTERISK_VARRUN_DIR__ ASTVARLOGDIR=__ASTERISK_LOG_DIR__ @@ -20,32 +19,23 @@ RUNDIR=${RUNDIR:-/tmp} SLEEPSECS=4 ASTPIDFILE=${ASTVARRUNDIR}/asterisk.pid -# Obtain parameters from the safe_asterisk.conf file in the -# ASTETCDIR directory +# comment this line out to have this script _not_ kill all mpg123 processes when +# asterisk exits +KILLALLMPG123=1 -kvalue=`grep ^KILLALLMPG123= $ASTETCDIR 2>/dev/null | cut -c 15` -if test "x$kvalue" != "x" ; then - KILLALLMPG123=$kvalue -else - KILLALLMPG123=0 -fi +# run asterisk with this priority +PRIORITY=0 -pvalue=`grep ^PRIORITY= $ASTETCDIR 2>/dev/null | cut -c 10` -if test "x$pvalue" != "x" ; then - PRIORITY=$pvalue -else - PRIORITY=0 -fi +# set system filemax on supported OSes if this variable is set +# SYSMAXFILES=262144 -svalue=`grep ^SYSMAXFILES= $ASTETCDIR 2>/dev/null | cut -c 13-21` -if test "x$svalue" != "x" ; then - SYSMAXFILES=$svalue -fi +# Asterisk allows full permissions by default, so set a umask, if you want +# restricted permissions. +#UMASK=022 -mvalue=`grep ^MAXFILES= $ASTETCDIR 2>/dev/null | cut -c 10-15` -if test "x$mvalue" != "x" ; then - MAXFILES=$mvalue -fi +# set max files open with ulimit. On linux systems, this will be automatically +# set to the system's maximum files open devided by two, if not set here. +# MAXFILES=32768 message() { echo "$1" >&2 @@ -106,10 +96,8 @@ else fi - -uvalue=`grep ^UMASK= $ASTETCDIR 2>/dev/null | cut -c 7-10` -if test "x$uvalue" != "x" ; then - umask $uvalue +if test "x$UMASK" != "x"; then + umask $UMASK fi # @@ -145,7 +133,7 @@ if test ! -d "${RUNDIR}" ; then fi fi -if test ! -w "${DUMPDROP}" ; then +if test ! -w "${DUMPDROP}" ; then message "Cannot write to ${DUMPDROP}" exit 1 fi @@ -169,7 +157,7 @@ fi run_asterisk() { - while :; do + while :; do if test "x$TTY" != "x" ; then cd "${RUNDIR}" |