Module: sip-router
Branch: master
Commit: 8b023bbab187020bff7883bad1e671c3cf2860c6
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8b023bbab187020bff7883bad1e671c3cf2860c6

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date:   Thu Dec 19 20:49:38 2013 +0100

kamctl: don't force global exit if gdb is not found

- it is not a general requirement, only for trap command

---

 utils/kamctl/kamctl      |    6 +++++-
 utils/kamctl/kamctl.base |    8 +++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl
index e6c87f1..519da55 100755
--- a/utils/kamctl/kamctl
+++ b/utils/kamctl/kamctl
@@ -2649,6 +2649,10 @@ extcmd() {
 #
 
 kamailio_trap() {
+       if [ -z "$GDB" ] ; then
+               merr "'gdb' tool not found: set GDB variable to correct tool 
path"
+               exit
+       fi
        DATE=`/bin/date +%Y%m%d_%H%M%S`
        LOG_FILE=/tmp/gdb_kamailio_$DATE
        minfo "Trap file: $LOG_FILE"
@@ -2661,7 +2665,7 @@ kamailio_trap() {
                PID=`echo $pid | cut -d '-' -f 1`
                echo "" >> $LOG_FILE
                echo "---start $PID 
-----------------------------------------------------" >> $LOG_FILE
-               $GDB kamailio $PID -batch --eval-command="bt full" &>> $LOG_FILE
+               $GDB kamailio $PID -batch --eval-command="bt full" & >> 
$LOG_FILE
                echo "---end $PID 
-------------------------------------------------------" >> $LOG_FILE
        done
        echo "."
diff --git a/utils/kamctl/kamctl.base b/utils/kamctl/kamctl.base
index 62d4c9b..bd2817b 100644
--- a/utils/kamctl/kamctl.base
+++ b/utils/kamctl/kamctl.base
@@ -57,10 +57,12 @@ if [ -z "$GDB" ] ; then
        locate_tool gdb
        if [ -z "$TOOLPATH" ] ; then
                # now error, but we can look for alternative names if it is the 
case
-               echo "error: 'gdb' tool not found: set GDB variable to correct 
tool path"
-               exit
+               GDB=""
+               # echo "error: 'gdb' tool not found: set GDB variable to 
correct tool path"
+               # exit
+       else
+               GDB="$TOOLPATH"
        fi
-       GDB="$TOOLPATH"
 fi
 if [ -z "$MD5" ]; then
        locate_tool md5sum md5


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to