]> git.sur5r.net Git - bacula/bacula/blob - bacula/scripts/btraceback.in
kes Fix mtx-changer to detect both versions of Ubuntu (Debian)
[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 PNAME=`basename $1`
12 PNAME="${PNAME} on `hostname`"
13 if test `uname -s` = SunOS ; then
14   gcore -o @working_dir@/${PNAME} $2
15   dbx $1 $2 <@scriptdir@/btraceback.dbx 2>&1 \
16    | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula DBX traceback of ${PNAME}" @dump_email@
17 else
18   gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 2>&1 \
19    | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula GDB traceback of ${PNAME}" @dump_email@
20 fi