From: Marco van Wieringen Date: Thu, 15 Apr 2010 18:57:23 +0000 (+0200) Subject: Small changes to btraceback script so on solaris we don't get strange errors as PNAME... X-Git-Tag: Release-7.0.0~1941 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=726d6d7dc55a6c25c4fdc8c080470f5e4620cde6;p=bacula%2Fbacula Small changes to btraceback script so on solaris we don't get strange errors as PNAME is not a single binary name and that doesn't work to great for doing a gcore. --- diff --git a/bacula/scripts/btraceback.in b/bacula/scripts/btraceback.in index 9b9a4882c7..959ce1544e 100755 --- a/bacula/scripts/btraceback.in +++ b/bacula/scripts/btraceback.in @@ -10,19 +10,20 @@ # $3 = working directory # PNAME=`basename $1` -PNAME="${PNAME} on `hostname`" WD="$3" if test `uname -s` = SunOS ; then - gcore -o ${WD}/${PNAME} $2 - if [ -x /usr/bin/mdb ]; then - mdb -u -p $2 <@scriptdir@/btraceback.mdb >${WD}/bacula.$2.traceback 2>&1 - else - dbx $1 $2 <@scriptdir@/btraceback.dbx >${WD}/bacula.$2.traceback 2>&1 - fi - cat ${WD}/bacula.$2.traceback \ - | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula DBX traceback of ${PNAME}" @dump_email@ + gcore -o ${WD}/${PNAME} $2 + if [ -x /usr/bin/mdb ]; then + mdb -u -p $2 <@scriptdir@/btraceback.mdb >${WD}/bacula.$2.traceback 2>&1 + else + dbx $1 $2 <@scriptdir@/btraceback.dbx >${WD}/bacula.$2.traceback 2>&1 + fi + PNAME="${PNAME} on `hostname`" + 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@ + gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 >${WD}/bacula.$2.traceback 2>&1 + PNAME="${PNAME} on `hostname`" + cat ${WD}/bacula.$2.traceback \ + | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula GDB traceback of ${PNAME}" @dump_email@ fi