[Pkg-voip-commits] r1361 - asterisk/trunk/debian
Kilian Krause
kilian at costa.debian.org
Fri Mar 3 09:44:00 UTC 2006
Author: kilian
Date: 2006-03-03 09:43:59 +0000 (Fri, 03 Mar 2006)
New Revision: 1361
Added:
asterisk/trunk/debian/asterisk-bristuff.asterisk.init
asterisk/trunk/debian/asterisk-classic.asterisk.init
Removed:
asterisk/trunk/debian/asterisk-bristuff.init
asterisk/trunk/debian/asterisk-classic.init
Modified:
asterisk/trunk/debian/asterisk-bristuff.logrotate
asterisk/trunk/debian/asterisk-classic.logrotate
asterisk/trunk/debian/changelog
asterisk/trunk/debian/postinst
asterisk/trunk/debian/rules
Log:
* postinstall: Add /var/spool/asterisk/meetme if nonexistant.
(Closes: #355046)
* asterisk.init: Install both asterisk-classic and asterisk-bristuff with
/etc/init.d/asterisk (Closes: #354729)
(Uses dh_installinit --name= switch.)
* logroate: moved logdir for CSV to /var/log/asterisk/cdr-custom/
(Closes: #355048)
Copied: asterisk/trunk/debian/asterisk-bristuff.asterisk.init (from rev 1358, asterisk/trunk/debian/asterisk-bristuff.init)
Deleted: asterisk/trunk/debian/asterisk-bristuff.init
===================================================================
--- asterisk/trunk/debian/asterisk-bristuff.init 2006-03-02 14:04:41 UTC (rev 1360)
+++ asterisk/trunk/debian/asterisk-bristuff.init 2006-03-03 09:43:59 UTC (rev 1361)
@@ -1,162 +0,0 @@
-#! /bin/sh
-#
-# asterisk start the asterisk PBX
-# (c) Mark Purcell <msp at debian.org>
-# May be distributed under the terms of this General Public License
-#
-# Based on:
-#
-# skeleton example file to build /etc/init.d/ scripts.
-# This file should be used to construct scripts for /etc/init.d.
-#
-# Written by Miquel van Smoorenburg <miquels at cistron.nl>.
-# Modified for Debian GNU/Linux
-# by Ian Murdock <imurdock at gnu.ai.mit.edu>.
-#
-# Version: @(#)skeleton 1.9 26-Feb-2001 miquels at cistron.nl
-#
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-NAME=asterisk
-USER=$NAME
-GROUP=$USER
-DAEMON=/usr/sbin/$NAME
-DESC="Asterisk PBX"
-PIDFILE="/var/run/asterisk/asterisk.pid"
-
-# by default: use real-time priority
-PARAMS=""
-AST_REALTIME="yes"
-RUNASTERISK="no"
-if [ -r /etc/default/$NAME ]; then . /etc/default/$NAME; fi
-
-if [ "$RUNASTERISK" != "yes" ];then
- echo "Asterisk not yet configured. Edit /etc/default/asterisk first."
- exit 1
-fi
-
-if [ "$AST_REALTIME" != "no" ]
-then
- PARAMS="$PARAMS -p"
-fi
-
-if [ "x$USER" = "x" ]
-then
- echo "Error: empty USER name"
- exit 1
-fi
-if [ `id -u "$USER"` = 0 ]
-then
- echo "Starting as root not supported."
- exit 1
-fi
-PARAMS="$PARAMS -U $USER"
-
-if [ "x$AST_DEBUG_PARAMS" = x ]
-then
- AST_DEBUG_PARAMS=-cvvvvvddddd
-fi
-if [ "$RUNASTSAFE" = "yes" ];then
- # The value of WRAPPER_DAEMON in can be set in /etc/default/asterisk
- WRAPPER_DAEMON=${WRAPPER_DAEMON:-/usr/sbin/safe_asterisk}
- REALDAEMON="$WRAPPER_DAEMON"
-else
- REALDAEMON="$DAEMON"
-fi
-
-test -x $DAEMON || exit 0
-
-set -e
-
-status() {
- plist=`ps auxw | grep "$DAEMON" | grep -v grep | awk '{print $2}' | tr '\012' ' '`
- if [ "$plist" = "" ]; then
- echo "$DESC is stopped"
- return 1
- else
- echo "$DESC is running: $plist"
- return 0
- fi
-}
-
-case "$1" in
- debug)
- # we add too many special parameters that I don't want to skip
- # accidentally. I'm afraid that skipping -U once may cause
- # confusing results. I also want to maintain the user's choice
- # of -p
- echo "Debugging $DESC: "
- $DAEMON $PARAMS $AST_DEBUG_PARAMS
- exit 0
- ;;
- start)
- if status > /dev/null; then
- echo "$DESC is already running. Use restart."
- exit 1
- fi
- echo -n "Starting $DESC: "
- if [ "$RUNASTSAFE" != "yes" ];then
- # TODO: what if we cought the wrapper just as its asterisk
- # was killed? status should check for the wrapper if we're in
- # "safe mode"
- if status > /dev/null; then
- echo "$DESC is already running. Use restart."
- exit 1
- fi
- fi
- echo -n "Starting $DESC: "
- start-stop-daemon --start --group $GROUP --pidfile "$PIDFILE" \
- --exec $REALDAEMON -- $PARAMS
- echo "$NAME."
- ;;
- stop)
- echo -n "Stopping $DESC: "
- if [ "$RUNASTSAFE" = "yes" ];then
- # hopefully this will work. Untested
- $REALDAEMON -rx 'stop now' > /dev/null || true
- else
- # Try gracefully.
- # this may hang in some cases. Specifically, when the asterisk
- # processes is stopped. No bother to worry about cleanup:
- # it will either fail or die when asterisk dies.
- ( $DAEMON -rx 'stop now' > /dev/null 2>&1 & ) &
- fi
- echo -n "$NAME"
- ## giving a small grace time to shut down cleanly.
- #sleep 2 # you can add timeouts in the comma
- if [ "$RUNASTSAFE" = "yes" ];then
- start-stop-daemon --quiet --oknodo --stop --exec $WRAPPER_DAEMON
- fi
- # just making sure it's really, really dead.
- # KILL is necessary just in case there's an asterisk -r in the background
- start-stop-daemon --stop --quiet --oknodo --retry=0/2/TERM/2/KILL/5 --exec $REALDAEMON
- echo "."
- ;;
- reload)
- echo "Reloading $DESC configuration files."
- $DAEMON -rx 'reload'
- ;;
- logger-reload)
- $DAEMON -rx 'logger reload'
- ;;
- extensions-reload)
- echo "Reloading $DESC configuration files."
- $DAEMON -rx 'extensions reload'
- ;;
- restart|force-reload)
- $0 stop
- $0 start
- ;;
- status)
- status
- exit $?
- ;;
- *)
- N=/etc/init.d/$NAME
- # echo "Usage: $N {start|stop|restart|reload|logger-reload|extensions-reload|force-reload}" >&2
- echo "Usage: $N {start|stop|status|debug|restart|force-reload}" >&2
- exit 1
- ;;
-esac
-
-exit 0
Modified: asterisk/trunk/debian/asterisk-bristuff.logrotate
===================================================================
--- asterisk/trunk/debian/asterisk-bristuff.logrotate 2006-03-02 14:04:41 UTC (rev 1360)
+++ asterisk/trunk/debian/asterisk-bristuff.logrotate 2006-03-03 09:43:59 UTC (rev 1361)
@@ -1,4 +1,4 @@
-/var/log/asterisk/cdr-csv/Master.csv /var/log/asterisk/debug /var/log/asterisk/event_log /var/log/asterisk/messages {
+/var/log/asterisk/cdr-custom/Master.csv /var/log/asterisk/debug /var/log/asterisk/event_log /var/log/asterisk/messages {
weekly
missingok
rotate 4
Copied: asterisk/trunk/debian/asterisk-classic.asterisk.init (from rev 1358, asterisk/trunk/debian/asterisk-classic.init)
Deleted: asterisk/trunk/debian/asterisk-classic.init
===================================================================
--- asterisk/trunk/debian/asterisk-classic.init 2006-03-02 14:04:41 UTC (rev 1360)
+++ asterisk/trunk/debian/asterisk-classic.init 2006-03-03 09:43:59 UTC (rev 1361)
@@ -1,162 +0,0 @@
-#! /bin/sh
-#
-# asterisk start the asterisk PBX
-# (c) Mark Purcell <msp at debian.org>
-# May be distributed under the terms of this General Public License
-#
-# Based on:
-#
-# skeleton example file to build /etc/init.d/ scripts.
-# This file should be used to construct scripts for /etc/init.d.
-#
-# Written by Miquel van Smoorenburg <miquels at cistron.nl>.
-# Modified for Debian GNU/Linux
-# by Ian Murdock <imurdock at gnu.ai.mit.edu>.
-#
-# Version: @(#)skeleton 1.9 26-Feb-2001 miquels at cistron.nl
-#
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-NAME=asterisk
-USER=$NAME
-GROUP=$USER
-DAEMON=/usr/sbin/$NAME
-DESC="Asterisk PBX"
-PIDFILE="/var/run/asterisk/asterisk.pid"
-
-# by default: use real-time priority
-PARAMS=""
-AST_REALTIME="yes"
-RUNASTERISK="no"
-if [ -r /etc/default/$NAME ]; then . /etc/default/$NAME; fi
-
-if [ "$RUNASTERISK" != "yes" ];then
- echo "Asterisk not yet configured. Edit /etc/default/asterisk first."
- exit 1
-fi
-
-if [ "$AST_REALTIME" != "no" ]
-then
- PARAMS="$PARAMS -p"
-fi
-
-if [ "x$USER" = "x" ]
-then
- echo "Error: empty USER name"
- exit 1
-fi
-if [ `id -u "$USER"` = 0 ]
-then
- echo "Starting as root not supported."
- exit 1
-fi
-PARAMS="$PARAMS -U $USER"
-
-if [ "x$AST_DEBUG_PARAMS" = x ]
-then
- AST_DEBUG_PARAMS=-cvvvvvddddd
-fi
-if [ "$RUNASTSAFE" = "yes" ];then
- # The value of WRAPPER_DAEMON in can be set in /etc/default/asterisk
- WRAPPER_DAEMON=${WRAPPER_DAEMON:-/usr/sbin/safe_asterisk}
- REALDAEMON="$WRAPPER_DAEMON"
-else
- REALDAEMON="$DAEMON"
-fi
-
-test -x $DAEMON || exit 0
-
-set -e
-
-status() {
- plist=`ps auxw | grep "$DAEMON" | grep -v grep | awk '{print $2}' | tr '\012' ' '`
- if [ "$plist" = "" ]; then
- echo "$DESC is stopped"
- return 1
- else
- echo "$DESC is running: $plist"
- return 0
- fi
-}
-
-case "$1" in
- debug)
- # we add too many special parameters that I don't want to skip
- # accidentally. I'm afraid that skipping -U once may cause
- # confusing results. I also want to maintain the user's choice
- # of -p
- echo "Debugging $DESC: "
- $DAEMON $PARAMS $AST_DEBUG_PARAMS
- exit 0
- ;;
- start)
- if status > /dev/null; then
- echo "$DESC is already running. Use restart."
- exit 1
- fi
- echo -n "Starting $DESC: "
- if [ "$RUNASTSAFE" != "yes" ];then
- # TODO: what if we cought the wrapper just as its asterisk
- # was killed? status should check for the wrapper if we're in
- # "safe mode"
- if status > /dev/null; then
- echo "$DESC is already running. Use restart."
- exit 1
- fi
- fi
- echo -n "Starting $DESC: "
- start-stop-daemon --start --group $GROUP --pidfile "$PIDFILE" \
- --exec $REALDAEMON -- $PARAMS
- echo "$NAME."
- ;;
- stop)
- echo -n "Stopping $DESC: "
- if [ "$RUNASTSAFE" = "yes" ];then
- # hopefully this will work. Untested
- $REALDAEMON -rx 'stop now' > /dev/null || true
- else
- # Try gracefully.
- # this may hang in some cases. Specifically, when the asterisk
- # processes is stopped. No bother to worry about cleanup:
- # it will either fail or die when asterisk dies.
- ( $DAEMON -rx 'stop now' > /dev/null 2>&1 & ) &
- fi
- echo -n "$NAME"
- ## giving a small grace time to shut down cleanly.
- #sleep 2 # you can add timeouts in the comma
- if [ "$RUNASTSAFE" = "yes" ];then
- start-stop-daemon --quiet --oknodo --stop --exec $WRAPPER_DAEMON
- fi
- # just making sure it's really, really dead.
- # KILL is necessary just in case there's an asterisk -r in the background
- start-stop-daemon --stop --quiet --oknodo --retry=0/2/TERM/2/KILL/5 --exec $REALDAEMON
- echo "."
- ;;
- reload)
- echo "Reloading $DESC configuration files."
- $DAEMON -rx 'reload'
- ;;
- logger-reload)
- $DAEMON -rx 'logger reload'
- ;;
- extensions-reload)
- echo "Reloading $DESC configuration files."
- $DAEMON -rx 'extensions reload'
- ;;
- restart|force-reload)
- $0 stop
- $0 start
- ;;
- status)
- status
- exit $?
- ;;
- *)
- N=/etc/init.d/$NAME
- # echo "Usage: $N {start|stop|restart|reload|logger-reload|extensions-reload|force-reload}" >&2
- echo "Usage: $N {start|stop|status|debug|restart|force-reload}" >&2
- exit 1
- ;;
-esac
-
-exit 0
Modified: asterisk/trunk/debian/asterisk-classic.logrotate
===================================================================
--- asterisk/trunk/debian/asterisk-classic.logrotate 2006-03-02 14:04:41 UTC (rev 1360)
+++ asterisk/trunk/debian/asterisk-classic.logrotate 2006-03-03 09:43:59 UTC (rev 1361)
@@ -1,4 +1,4 @@
-/var/log/asterisk/cdr-csv/Master.csv /var/log/asterisk/debug /var/log/asterisk/event_log /var/log/asterisk/messages {
+/var/log/asterisk/cdr-custom/Master.csv /var/log/asterisk/debug /var/log/asterisk/event_log /var/log/asterisk/messages {
weekly
missingok
rotate 4
Modified: asterisk/trunk/debian/changelog
===================================================================
--- asterisk/trunk/debian/changelog 2006-03-02 14:04:41 UTC (rev 1360)
+++ asterisk/trunk/debian/changelog 2006-03-03 09:43:59 UTC (rev 1361)
@@ -1,8 +1,14 @@
asterisk (1:1.2.4.dfsg-7) UNRELEASED; urgency=low
* NOT RELEASED YET
+ * postinstall: Add /var/spool/asterisk/meetme if nonexistant.
+ (Closes: #355046)
+ * asterisk.init: Install both asterisk-classic and asterisk-bristuff with
+ /etc/init.d/asterisk (Closes: #354729)
+ * logroate: moved logdir for CSV to /var/log/asterisk/cdr-custom/
+ (Closes: #355048)
- -- Kilian Krause <kilian at debian.org> Sun, 26 Feb 2006 14:28:59 +0100
+ -- Kilian Krause <kilian at debian.org> Fri, 3 Mar 2006 10:41:36 +0100
asterisk (1:1.2.4.dfsg-6) unstable; urgency=low
Modified: asterisk/trunk/debian/postinst
===================================================================
--- asterisk/trunk/debian/postinst 2006-03-02 14:04:41 UTC (rev 1360)
+++ asterisk/trunk/debian/postinst 2006-03-03 09:43:59 UTC (rev 1361)
@@ -27,8 +27,16 @@
adduser asterisk dialout
fi
- test -d /var/log/asterisk/cdr-csv || mkdir -p /var/log/asterisk/cdr-csv
+ if [ -d /var/log/asterisk/cdr-csv -a ! -d /var/log/asterisk/cdr-custom ];then
+ mv /var/log/asterisk/cdr-csv /var/log/asterisk/cdr-custom
+ elif [ -d /var/log/asterisk/cdr-csv -a -d /var/log/asterisk/cdr-custom ];then
+ echo 'Found obsolete /var/log/asterisk/cdr-csv.'
+ echo 'Please move files manually to new location: /var/log/asterisk/cdr-custom'
+ elif [ ! -d /var/log/asterisk/cdr-custom ];then
+ mkdir -p /var/log/asterisk/cdr-custom
+ fi
test -d /var/spool/asterisk/voicemail || mkdir -p /var/spool/asterisk/voicemail
+ test -d /var/spool/asterisk/meetme || mkdir -p /var/spool/asterisk/meetme
test -d /var/lib/asterisk || mkdir -p /var/lib/asterisk
test -d /etc/asterisk || mkdir -p /etc/asterisk
chown -R asterisk.asterisk /var/log/asterisk /var/run/asterisk \
Modified: asterisk/trunk/debian/rules
===================================================================
--- asterisk/trunk/debian/rules 2006-03-02 14:04:41 UTC (rev 1360)
+++ asterisk/trunk/debian/rules 2006-03-03 09:43:59 UTC (rev 1361)
@@ -190,7 +190,7 @@
dh_installman -pasterisk-classic -pasterisk-bristuff *.[1-8] debian/*.1 debian/*.8
dh_installexamples -a -XCVS
dh_installlogrotate -a
- dh_installinit -a -- defaults 21
+ dh_installinit -a --name=asterisk -- defaults 21
dh_installchangelogs ChangeLog -a
dh_strip -a
dh_link -a
More information about the Pkg-voip-commits
mailing list