[Pkg-voip-commits] [dahdi-tools] 249/285: xpp: bugfix: waitfor_xpds twinstar, auto_assign_spans

tzafrir at debian.org tzafrir at debian.org
Thu Jul 7 19:19:06 UTC 2016


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

tzafrir pushed a commit to branch master
in repository dahdi-tools.

commit ec1ebffa89de6a6e64b30f7b2a742d7fffcb3650
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Mon Jul 13 19:09:42 2015 +0300

    xpp: bugfix: waitfor_xpds twinstar, auto_assign_spans
    
    Exposed in twinstar setups where dahdi has auto_assign_spans=1:
    * We start configuration with an empty /etc/dahdi/xpp_order
    * If "XPP_HOTPLUG_DAHDI=yes", the astribank_hook removes
      the asterisk_is_starting semaphore too early.
    * There's no point in waiting for non-existant or empty /etc/dahdi/xpp_order
    
    Signed-off-by: Oron Peled <oron.peled at xorcom.com>
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
---
 xpp/waitfor_xpds | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/xpp/waitfor_xpds b/xpp/waitfor_xpds
index 876a0c8..41fce4c 100755
--- a/xpp/waitfor_xpds
+++ b/xpp/waitfor_xpds
@@ -89,6 +89,10 @@ waitfor_ab_initialization() {
 	done
 }
 
+clean_lines() {
+	sed -e 's/#.*//' -e 'y/\t/ /' -e 's/^ *//' -e 's/ *$//' -e '$s/$/\n/' "$1"
+}
+
 # Any hardware?
 if ! dahdi_hardware="`which dahdi_hardware 2>/dev/null`"; then
 	echo >&2 "$0: Missing dahdi_hardware"
@@ -150,13 +154,19 @@ cat /sys/bus/astribanks/devices/*/waitfor_xpds 2> /dev/null || :
 echo 1>&2 "Astribanks initializing spans"
 if [ "$XPP_HOTPLUG_DAHDI" = yes -a "$CALLED_FROM_ATRIBANK_HOOK" = '' -a \
 		"$ASTERISK_SUPPORTS_DAHDI_HOTPLUG" != 'yes'  ]; then
-	if [ -f /etc/dahdi/xpp_order ]; then
-		# Now we can wait until the hotplug run would remove the semaphore
-		echo -n 1>&2 "Other DAHDI initializations... "
-		astribank_is_starting -v -w 1>&2
-	else
+	if [ ! -f /etc/dahdi/xpp_order ]; then
 		echo 1>&2 "WARNING: No ASTERISK_SUPPORTS_DAHDI_HOTPLUG" \
 			" and no /etc/dahdi/xpp_order"
+	else
+		count=`clean_lines /etc/dahdi/xpp_order | wc -l`
+		if [ "$count" -le 0 ]; then
+			echo 1>&2 "WARNING: No ASTERISK_SUPPORTS_DAHDI_HOTPLUG" \
+				" and empty /etc/dahdi/xpp_order"
+		else
+			# Now we can wait until the hotplug run would remove the semaphore
+			echo -n 1>&2 "Other DAHDI initializations... "
+			astribank_is_starting -v -w 1>&2
+		fi
 	fi
 fi
 # All Astribanks initialized -- remove semaphore

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



More information about the Pkg-voip-commits mailing list