File: btraceback.in

package info (click to toggle)
bacula 1.36.2-2sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 21,520 kB
  • ctags: 8,940
  • sloc: ansic: 71,494; sh: 10,960; cpp: 7,331; makefile: 2,976; perl: 565; sql: 159; sed: 100; awk: 8; xml: 7
file content (19 lines) | stat: -rwxr-xr-x 613 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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.
#
PNAME=`basename $1`
if test `uname -s` = SunOS ; then
  gcore -o @working_dir@/${PNAME} $2
  dbx $1 $2 <@scriptdir@/btraceback.dbx 2>&1 \
   | @sbindir@/bsmtp -h @smtp_host@ -s "Bacula DBX traceback of ${PNAME}" @dump_email@
else
  gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 2>&1 \
   | @sbindir@/bsmtp -h @smtp_host@ -s "Bacula GDB traceback of ${PNAME}" @dump_email@
fi