[Pkg-voip-commits] [asterisk] 01/01: rollback changes to init script

Jeremy Lainé sharky at moszumanska.debian.org
Tue May 27 07:03:47 UTC 2014


This is an automated email from the git hooks/post-receive script.

sharky pushed a commit to branch master
in repository asterisk.

commit 6204f3210de07b4985b4ca23fcbee22d7a27bad0
Author: Jeremy Lainé <jeremy.laine at m4x.org>
Date:   Tue May 27 09:03:36 2014 +0200

    rollback changes to init script
---
 debian/asterisk.init | 34 +++++++++-------------------------
 debian/changelog     |  6 ++++++
 2 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/debian/asterisk.init b/debian/asterisk.init
index fd770ef..715b4e9 100644
--- a/debian/asterisk.init
+++ b/debian/asterisk.init
@@ -24,18 +24,13 @@
 
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 NAME=asterisk
-INSTANCE=$NAME
 USER=$NAME
 GROUP=$USER
 DAEMON=/usr/sbin/$NAME
 CANARY=/usr/sbin/astcanary
 DESC="Asterisk PBX"
-ETCDIR=/etc/$INSTANCE
-LOGDIR=/var/log/$INSTANCE
-RUNDIR=/var/run/$INSTANCE
-PIDFILE="${RUNDIR}/asterisk.pid"
-ASTSAFE_PIDFILE="${RUNDIR}/asterisk_safe.pid"
-ASTCTL="${RUNDIR}/${NAME}.ctl"
+PIDFILE="/var/run/asterisk/asterisk.pid"
+ASTSAFE_PIDFILE="/var/run/asterisk/asterisk_safe.pid"
 UMASK=007 # by default
 #MAXFILES=1024 # (the system default)
 
@@ -50,21 +45,13 @@ AST_DUMPCORE="no"
 AST_DUMPCORE_DIR="/var/spool/asterisk" # only used if AST_DUMPCORE != no
 # core_pattern. See: http://lxr.linux.no/source/Documentation/sysctl/kernel.txt
 #CORE_PATTERN=
-if [ -r /etc/default/$INSTANCE ]; then . /etc/default/$INSTANCE ; fi
+if [ -r /etc/default/$NAME ]; then . /etc/default/$NAME; fi
 
 if [ "$RUNASTERISK" != "yes" ];then
-	echo "Asterisk not yet configured. Edit /etc/default/$INSTANCE first."
+	echo "Asterisk not yet configured. Edit /etc/default/asterisk first."
 	exit 0
 fi
 
-if [ ! -z "$ETCDIR" ]
-then
-   PARAMS="$PARAMS -C $ETCDIR"
-fi
-if [ ! -z "$ASTCTL" ]
-then
-   PARAMS="$PARAMS -s $ASTCTL"
-fi
 if [ "$AST_REALTIME" != "no" ]
 then
   PARAMS="$PARAMS -p"
@@ -109,7 +96,7 @@ fi
 
 test -x $DAEMON || exit 0
 
-for dir in ${RUNDIR} ${LOGDIR} ${LOGDIR}/cdr-csv ${LOGDIR}/cdr-custom; do
+for dir in /var/run/asterisk /var/log/asterisk /var/log/asterisk/cdr-csv /var/log/asterisk/cdr-custom; do
 	[ -d $dir ] || install -d -o $USER -g $GROUP $dir
 	[ -x /sbin/restorecon ] && /sbin/restorecon $dir
 done
@@ -128,9 +115,6 @@ then
 fi
 
 status() {
-	# it is not clear whether it is better to use $NAME or $INSTANCE here,
-	# status_of_proc will always try to use the PID file if it really exists
-	# fortunately
 	status_of_proc -p "$PIDFILE" "$NAME" "$DESC" && return 0 || return $?
 }
 
@@ -140,7 +124,7 @@ asterisk_rx() {
 	# if $HOME is set, asterisk -rx writes a .asterisk_history there
 	(
 		unset HOME
-		$DAEMON -r -s "${ASTCTL}" -x "$1"
+		$DAEMON -rx "$1"
 	)
 }
 
@@ -180,10 +164,10 @@ case "$1" in
 	fi
 		
 	
-	echo "$INSTANCE."
+	echo "$NAME."
 	;;
   stop)
-	echo -n "Stopping $DESC: $INSTANCE"
+	echo -n "Stopping $DESC: $NAME"
 	# Try gracefully.
 	# this may hang in some cases. Specifically, when the asterisk
 	# processes is stopped. No bother to worry about cleanup: 
@@ -223,7 +207,7 @@ case "$1" in
 	exit $?
 	;;
   *)
-	N=/etc/init.d/$INSTANCE
+	N=/etc/init.d/$NAME
 	echo "Usage: $N {start|stop|restart|reload|status|debug|logger-reload|extensions-reload|restart-convenient|force-reload}" >&2
 	exit 1
 	;;
diff --git a/debian/changelog b/debian/changelog
index e4c95c3..76aa84b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+asterisk (1:11.9.0~dfsg-2) UNRELEASED; urgency=medium
+
+  * Rollback changes to init script (Closes: #749024).
+
+ -- Jeremy Lainé <jeremy.laine at m4x.org>  Tue, 27 May 2014 08:58:14 +0200
+
 asterisk (1:11.9.0~dfsg-1) unstable; urgency=medium
 
   [ Jeremy Lainé ]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/asterisk.git



More information about the Pkg-voip-commits mailing list