]> git.sur5r.net Git - bacula/bacula/blob - bacula/scripts/btraceback.in
Added wxbutils.cpp.
[bacula/bacula] / bacula / scripts / btraceback.in
1 #!/bin/sh
2
3 # Script to do a stackdump of a Bacula daemon/program.
4 #
5 # We attempt to attach to running program
6 #
7 # Arguments to this script are
8 #  $1 = path to executable
9 #  $2 = main pid of running program to be traced back.
10 #
11 gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 2>&1 \
12  | @sbindir@/bsmtp -h @smtp_host@ -s "Bacula traceback" @dump_email@
13
14 #
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.
18 #i=0
19 #core=
20 #echo "In modified btraceback"
21 #echo "$1 $2"
22 #pwd
23 #while [ "$i" -lt 60 ] ; do
24 #  if [ -f core ] ; then
25 #     break;
26 #  fi
27 #  if [ -f core.$2 ] ; then
28 #     core=core.$2
29 #     break 
30 #  fi 
31 #  sleep 1
32 #  i=`expr $i + 1`
33 #done
34
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@
37 #else
38 #   gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 2>&1 | mail -s "Bacula traceback" @dump_email@
39 #fi