[Pkg-voip-commits] r4514 - in /asterisk1.2/trunk/debian: README.Debian asterisk.default asterisk1.2.asterisk.init changelog
tzafrir-guest at alioth.debian.org
tzafrir-guest at alioth.debian.org
Wed Sep 19 09:34:47 UTC 2007
Author: tzafrir-guest
Date: Wed Sep 19 09:34:47 2007
New Revision: 4514
URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=4514
Log:
* Sync documentation and init scripts from 1.4.
- LSB stanza.
- Mkdir PID dir on startup.
- MAXFILES
- restart-convinient
- core dumping parameters.
Modified:
asterisk1.2/trunk/debian/README.Debian
asterisk1.2/trunk/debian/asterisk.default
asterisk1.2/trunk/debian/asterisk1.2.asterisk.init
asterisk1.2/trunk/debian/changelog
Modified: asterisk1.2/trunk/debian/README.Debian
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk1.2/trunk/debian/README.Debian?rev=4514&op=diff
==============================================================================
--- asterisk1.2/trunk/debian/README.Debian (original)
+++ asterisk1.2/trunk/debian/README.Debian Wed Sep 19 09:34:47 2007
@@ -15,13 +15,9 @@
=========================
By default the package will create user and group 'asterisk' and will run as
them. It will run with real-time priority (-p) by default. It will also add
-itself to the group audio to enable the daemon to access sound cards. Running
-as root is disabled in /etc/init.d/asterisk for security reasons. If you use
-zaptel devices (like zaphfc too), you need to set permissions on /dev/zap to
-root.dialout or whatever other group you like and add the asterisk user to that
-group. Then make sure all the devicenodes below /dev/zap/ are 660 or asterisk
-will not have any access still. When no -G is given to the asterisk PARAMS,
-then asterisk will automatically initialize all groups of the asterisk user.
+itself to the group audio to enable the daemon to access sound cards and to
+the group dialout to access Zaptel devices. Running as root is disabled in
+/etc/init.d/asterisk for security reasons.
To change those values you can edit /etc/default/asterisk.
@@ -33,15 +29,17 @@
are also extensions-reload ('extensions reload') and logger-reload
('logger-reload') to load only parts of the configuration file.
-Asterisk supports a number of non-default paramters at startup. For debugging
+Asterisk supports a number of non-default parameters at startup. For debugging
it is often useful to run 'asterisk -U asterisk -vvvgc' from the console. Add
more -v for even higher verbosity. You can attach a remote console to a running
asterisk daemon with 'asterisk -vcr'. When testing, make sure to use the "-U
asterisk", or asterisk may write files with root ownership. In that case you
might not be able to restart the daemon without altering permissions to the
-files first. Alternatively use '/etc/init.d/asterisk debug'.
+files first.
-Asterisk is run with a umask of 002 by default, to allow writing
+Alternatively use '/etc/init.d/asterisk debug'.
+
+Asterisk is run with a umask of 007 by default, to allow writing
group-owned voicemail files. To change this value, set the value if 'UMASK'
in /etc/default/asterisk .
@@ -60,6 +58,15 @@
http://www.asteriskdocs.org/ (Asterisk Handbook)
+Open Files Limit
+===============
+Asterisk uses one file-handle (and sometimes more) per call. Hence if you
+have many simultaneous calls, you often bump into the per-process limit
+of 1024 file handles, and get the error: "Too man open files".
+
+To enlarge that limit, set: MAXFILES in /etc/default/zaptel.
+
+
Enjoy your PBX!
Kilian Krause (for the pkg-voip team)
Modified: asterisk1.2/trunk/debian/asterisk.default
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk1.2/trunk/debian/asterisk.default?rev=4514&op=diff
==============================================================================
--- asterisk1.2/trunk/debian/asterisk.default (original)
+++ asterisk1.2/trunk/debian/asterisk.default Wed Sep 19 09:34:47 2007
@@ -1,25 +1,68 @@
# This file allows you to alter the configuration of the Asterisk
-# init.d script
+# init.d script. Normally you should leave the file as-is.
#
-# RUNASTERISK: run asterisk upon boot. Should be set to "yes" once you have
-# setup your configuration.
-RUNASTERISK=no
+# RUNASTERISK: If set to anything other that 'yes', the asterisk init.d script
+# will not run. The default is 'yes'.
+#RUNASTERISK=no
#
#
# AST_REALTIME: if set to anything other than "no", asterisk will run in
# real-time priority (pass '-p' to asterisk). un-rem the
# following line to disable asterisk from running in real-time
# priority
-#AST_REALTIME=yes
+#AST_REALTIME=no
#
-# PARAMS: extra parameters to pass to asterisk
-# The example here may help you in debugging, but is
-# *not**intended**for**production**use*.
-# When you give -G *only* that group will be used,
-# else all groups of the asterisk user.
-#PARAMS="-D -g -vvv"
+# PARAMS: extra parameters to pass to asterisk: generate cores in
+# case of crash, and be more verbose. -F guarantees that Asterisk
+# will still run daemonized.
+#
+# Instead of adding switches here, consider editing
+# /etc/asterisk/asterisk.conf
+#PARAMS="-F -g -vvv"
#
#
# RUNASTSAFE: run safe_asterisk rather than asterisk (will auto-restart upon
-# crash)
+# crash). This is generally less tested and has some known issues
+# with properly starting and stopping Asterisk.
#RUNASTSAFE=yes
+#
+#
+# MAXFILES: Set this to the number of open file handles the Asterisk
+# process can have. Useful if you get "Too many open files" error.
+#MAXFILES=8192
+#
+# AST_DUMPCORE: if set to anything other than "no", asterisk will be run with
+# the option -g (to tell it to dump core on crash) and its
+# working directory will be set to /var/spool/asterisk, as that
+# directory is writable and hence core files can be written there.
+# See /etc/init.d/asterisk for some other relevant variables.
+#
+# It is recommended that you install asterisk-dbg to be able
+# to produce meaningful backtraces from the core file.
+#
+# By default core files will be written to /tmp (can be
+# changed by setting AST_DUMPCORE_DIR). Alternatively, see
+# CORE_PATTERN below.
+#AST_DUMPCORE=yes
+#
+# DUMPCORE_DIR: By default asterisk runs in the directory '/' like any
+# daemon. Setting this allows you to tell it to tell the
+# Asterisk daemon to run in a different directory if
+# AST_DUMPCORE is enabled. The default is /tmp and is
+# probably a sane one.
+#
+# CORE_PATTERN: If you use AST_DUMPCORE above, this is optionally set to a
+# pattern of the core file. The default is not to touch the
+# core_pattern settings, which is generally a good idea as
+# it affects every core file generated on your system.
+#
+# However if you just enable generation of core files and run
+# asterisk as a daemon it will fail to write core files.
+#
+# Alternatively you can set this independently elsewhere.
+# See http://lxr.linux.no/source/Documentation/sysctl/kernel.txt
+# Here is what Asterisk's ast_grab_core
+# script would expect:
+#CORE_PATTERN='/tmp/core.%p'
+# But you might prefer something like:
+#CORE_PATTERN='/tmp/core.%e.%t'
Modified: asterisk1.2/trunk/debian/asterisk1.2.asterisk.init
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk1.2/trunk/debian/asterisk1.2.asterisk.init?rev=4514&op=diff
==============================================================================
--- asterisk1.2/trunk/debian/asterisk1.2.asterisk.init (original)
+++ asterisk1.2/trunk/debian/asterisk1.2.asterisk.init Wed Sep 19 09:34:47 2007
@@ -2,7 +2,10 @@
#
# asterisk start the asterisk PBX
# (c) Mark Purcell <msp at debian.org>
-# May be distributed under the terms of this General Public License
+# This package is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
#
# Based on:
#
@@ -15,6 +18,18 @@
#
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels at cistron.nl
#
+
+### BEGIN INIT INFO
+# Provides: asterisk
+# Required-Start: $local_fs zaptel
+# Required-Stop: $local_fs
+# Should-Start:
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Asterisk PBX
+# Description: Controls the Asterisk PBX
+### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=asterisk
@@ -24,13 +39,20 @@
DESC="Asterisk PBX"
PIDFILE="/var/run/asterisk/asterisk.pid"
ASTSAFE_PIDFILE="/var/run/asterisk/asterisk_safe.pid"
+PIDFILE_DIR=`dirname $PIDFILE`
UMASK=007 # by default
-
+#MAXFILES=1024 # (the system default)
# by default: use real-time priority
PARAMS=""
+CHDIR_PARM=""
AST_REALTIME="yes"
RUNASTERISK="yes"
+AST_DUMPCORE="no"
+AST_DUMPCORE_DIR="/tmp" # only used if AST_DUMPCORE != yes
+AST_DUMPCORE_DIR="/var/spool/asterisk"
+# core_pattern. See: http://lxr.linux.no/source/Documentation/sysctl/kernel.txt
+#CORE_PATTERN=
if [ -r /etc/default/$NAME ]; then . /etc/default/$NAME; fi
if [ "$RUNASTERISK" != "yes" ];then
@@ -41,6 +63,19 @@
if [ "$AST_REALTIME" != "no" ]
then
PARAMS="$PARAMS -p"
+fi
+
+if [ "$AST_DUMPCORE" != "no" ]
+then
+ PARAMS="$PARAMS -g"
+ if [ "$CORE_PATTERN" != '' ]
+ then
+ echo "$CORE_PATTERN" >/proc/sys/kernel/core_pattern
+ fi
+ if [ -d "$DUMPCORE_DIR" ]
+ then
+ CHDIR_PARM="--chdir $AST_DUMPCORE_DIR"
+ fi
fi
if [ "x$USER" = "x" ]
@@ -69,11 +104,22 @@
test -x $DAEMON || exit 0
+if [ ! -d "$PIDFILE_DIR" ];then
+ mkdir "$PIDFILE_DIR"
+ chown $USER:$GROUP "$PIDFILE_DIR"
+fi
+
set -e
if [ "$UMASK" != '' ]
then
umask $UMASK
+fi
+
+# allow changing the per-process open files limit:
+if [ "$MAXFILES" != '' ]
+then
+ ulimit -n $MAXFILES
fi
status() {
@@ -117,10 +163,11 @@
exit 0
fi
start-stop-daemon --start --group $GROUP --pidfile "$PIDFILE" \
+ $CHDIR_PARM \
--exec $REALDAEMON -- $PARAMS
else
start-stop-daemon --start --group $GROUP --make-pidfile \
- --pidfile "$ASTSAFE_PIDFILE" \
+ $CHDIR_PARM --pidfile "$ASTSAFE_PIDFILE" \
--exec $REALDAEMON -- $PARAMS
fi
@@ -161,6 +208,9 @@
extensions-reload)
echo "Reloading $DESC configuration files."
asterisk_rx 'extensions reload'
+ ;;
+ restart-convenient)
+ asterisk_rx 'restart when convenient'
;;
restart|force-reload)
$0 stop
@@ -182,7 +232,7 @@
;;
*)
N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|restart|reload|status|debug|logger-reload|extensions-reload|force-reload}" >&2
+ echo "Usage: $N {start|stop|restart|reload|status|debug|logger-reload|extensions-reload|restart-convenient|force-reload}" >&2
exit 1
;;
esac
Modified: asterisk1.2/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk1.2/trunk/debian/changelog?rev=4514&op=diff
==============================================================================
--- asterisk1.2/trunk/debian/changelog (original)
+++ asterisk1.2/trunk/debian/changelog Wed Sep 19 09:34:47 2007
@@ -22,8 +22,14 @@
* Allow some extra conflicts to allow upgrading from old asterisk 1.2
packages.
* Fix logrotate file: remove hardwiring. Add missing files.
-
- -- Tzafrir Cohen <tzafrir.cohen at xorcom.com> Mon, 10 Sep 2007 13:55:06 +0300
+ * Sync documentation and init scripts from 1.4.
+ - LSB stanza.
+ - Mkdir PID dir on startup.
+ - MAXFILES
+ - restart-convinient
+ - core dumping parameters.
+
+ -- Tzafrir Cohen <tzafrir.cohen at xorcom.com> Wed, 19 Sep 2007 11:21:24 +0200
asterisk (1:1.2.16~dfsg-1) unstable; urgency=high
More information about the Pkg-voip-commits
mailing list