File: btraceback.in

package info (click to toggle)
bacula 5.0.2-2.2%2Bsqueeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 22,692 kB
  • ctags: 15,071
  • sloc: ansic: 109,509; cpp: 24,105; sh: 21,958; makefile: 4,012; perl: 3,083; sql: 1,366; lisp: 479; python: 166; xml: 64; sed: 32; awk: 8
file content (24 lines) | stat: -rwxr-xr-x 820 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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.
#  $3 = working directory
#
PNAME=`basename $1`
PNAME="${PNAME} on `hostname`"
WD="$3"
if test `uname -s` = SunOS ; then
  gcore -o ${WD}/${PNAME} $2
  dbx $1 $2 <@scriptdir@/btraceback.dbx >${WD}/bacula.$2.traceback 2>&1
  cat ${WD}/bacula.$2.traceback \
   | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula DBX traceback of ${PNAME}" @dump_email@
else
  gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 >${WD}/bacula.$2.traceback 2>&1
  cat ${WD}/bacula.$2.traceback \
   | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula GDB traceback of ${PNAME}" @dump_email@
fi