#!/bin/sh
# 
# Script to do a stackdump of a Bacula daemon/program.
#
# We attempt to attach to running program
#
# Arguments to this script are
#  $1 = path to executable
#  $2 = main pid of running program to be traced back.
#
gdb -quiet -batch -x /usr/lib/bacula/btraceback.gdb $1 $2 2>&1 \
 | /usr/lib/bacula/bsmtp -h localhost -s "Bacula traceback" root
