]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add scripts from MODAPP-89
authorBrian West <brian@freeswitch.org>
Thu, 24 Jul 2008 16:14:20 +0000 (16:14 +0000)
committerBrian West <brian@freeswitch.org>
Thu, 24 Jul 2008 16:14:20 +0000 (16:14 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9169 d0543943-73ff-0310-b7d9-9358b9ac24b2

scripts/freeswitch-gcore [new file with mode: 0644]
scripts/freeswitch-reporter [new file with mode: 0644]

diff --git a/scripts/freeswitch-gcore b/scripts/freeswitch-gcore
new file mode 100644 (file)
index 0000000..7ddbdff
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+fspid=$(cat /usr/local/freeswitch/log/freeswitch.pid)
+gcore -o /usr/local/freeswitch/log/freeswitch.gcore $fspid && \
+       gdb /usr/local/freeswitch/bin/freeswitch \
+       -c /usr/local/freeswitch/log/freeswitch.gcore.$fspid \
+       --eval-command='set pagination off' \
+       --eval-command='bt' \
+       --eval-command='bt full' \
+       --eval-command='thread apply all bt' \
+       --eval-command='thread apply all bt full' \
+       --eval-command='quit'
+rm /usr/local/freeswitch/log/freeswitch.gcore.$fspid
diff --git a/scripts/freeswitch-reporter b/scripts/freeswitch-reporter
new file mode 100644 (file)
index 0000000..6dee034
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash
+email=traces@freeswitch.org
+errorlvl=1
+while [ $errorlvl -gt 0 ]
+do
+       /usr/local/freeswitch/bin/freeswitch -core
+       errorlvl=$?
+       if [ $errorlvl -gt 0 ]; then
+               pid=$(cat /usr/local/freeswitch/log/freeswitch.pid)
+               corefile=core.$pid
+               tempfile=$(tempfile)
+               if [ -f $corefile ]; then
+                       reset
+                       echo From: freeswitch@jasongarland.com >>$tempfile
+                       echo >>$tempfile
+                       echo >>$tempfile
+                       echo Host: $(hostname -f) >>$tempfile
+                       gdb /usr/local/freeswitch/bin/freeswitch -c $corefile \
+                       --eval-command='set pagination off' \
+                       --eval-command='bt full' \
+                       --eval-command='quit' >>$tempfile
+                       cat $tempfile|rmail $email
+                       rm $tempfile
+               fi
+       fi
+
+       #sleep 5s
+
+done