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.
11 gdb -quiet -batch -x @sbindir@/btraceback.gdb $1 $2 2>&1 \
12 | @sbindir@/bsmtp -h @smtp_host@ -s "Bacula traceback" @dump_email@
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 @sbindir@/btraceback.gdb $1 $core 2>&1 | mail -s "Bacula traceback" @dump_email@
37 # gdb -quiet -batch -x @sbindir@/btraceback.gdb $1 $2 2>&1 | mail -s "Bacula traceback" @dump_email@