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 @scriptdir@/btraceback.gdb $1 $2 2>&1 \
12 | @sbindir@/bsmtp -h @smtp_host@ -s "Bacula traceback" @dump_email@
15 # Below is some old code that did the traceback from a core
16 # dump. However, for security reasons, core dumps of uid=root
17 # programs are not always produced.
20 #echo "In modified btraceback"
23 #while [ "$i" -lt 60 ] ; do
24 # if [ -f core ] ; then
27 # if [ -f core.$2 ] ; then
35 #if test x$core != x; then
36 # gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $core 2>&1 | mail -s "Bacula traceback" @dump_email@
38 # gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 2>&1 | mail -s "Bacula traceback" @dump_email@