3 # Script to do a stackdump of a Bacula daemon/program.
5 # We attempt to attach to running program
7 # Arguments to this script are
8 # $1 = path to executable
9 # $2 = main pid of running program to be traced back.
12 gdb -quiet -batch -x /bacula/bin/btraceback.gdb $1 $2 2>&1 | mail -s "Bacula traceback" root
14 # Below is some old code that did the traceback from a core
15 # dump. However, for some odd reason, core dumps are not
19 #echo "In modified btraceback"
22 #while [ "$i" -lt 60 ] ; do
23 # if [ -f core ] ; then
26 # if [ -f core.$2 ] ; then
34 #if test x$core != x; then
35 # gdb -quiet -batch -x /home/kern/bacula/bin/btraceback.gdb $1 $core 2>&1 | mail -s "Bacula traceback" kern@sibbald.com
37 # gdb -quiet -batch -x /home/kern/bacula/bin/btraceback.gdb $1 $2 2>&1 | mail -s "Bacula traceback" kern@sibbald.com