summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSven Hartge <sven@svenhartge.de>2021-02-06 19:43:10 +0100
committerSven Hartge <sven@svenhartge.de>2021-02-06 19:43:10 +0100
commit4f260c33d8bcd5d76763086f8c8aa0e89a9a5b90 (patch)
tree3741943411000681d7b1e149d695544126d78c2e /scripts
parentcbcb4b3e2dc185138ddb6a2fa43300190d610914 (diff)
New upstream version 11.0.1
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/btraceback.in23
-rw-r--r--scripts/mtx-changer.conf6
2 files changed, 22 insertions, 7 deletions
diff --git a/scripts/btraceback.in b/scripts/btraceback.in
index f922aa90..532c8972 100755
--- a/scripts/btraceback.in
+++ b/scripts/btraceback.in
@@ -34,6 +34,12 @@ WD="$3"
if [ "$WD" = "" ]; then
WD=/tmp
fi
+
+# Start constructing message. Point to log files for better user
+# experience, append backtrace or message about missing debugger later
+echo "Check the log files for more information." > ${WD}/bacula.$2.traceback
+echo "" >> ${WD}/bacula.$2.traceback
+
case `uname -s` in
SunOS)
#
@@ -57,14 +63,17 @@ SunOS)
elif [ ! -z "${MDB}" ]; then
${MDB} -u -p $2 < @scriptdir@/btraceback.mdb >> ${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@
;;
*)
- 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@
+ which gdb > /dev/null 2>&1 && GDB=`which gdb` || GDB=''
+ if [ ! -z "${GDB}" ]; then
+ gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 >> ${WD}/bacula.$2.traceback 2>&1
+ else
+ echo "Please install a debugger (gdb) to receive a traceback." >> ${WD}/bacula.$2.traceback 2>&1
+ fi
;;
esac
+
+PNAME="${PNAME} on `hostname`"
+cat ${WD}/bacula.$2.traceback \
+ | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula traceback. Process crashed ${PNAME}" @dump_email@
diff --git a/scripts/mtx-changer.conf b/scripts/mtx-changer.conf
index 981efb9e..8d511700 100644
--- a/scripts/mtx-changer.conf
+++ b/scripts/mtx-changer.conf
@@ -67,6 +67,7 @@ idbglvl=10
# When a tape is in the drive, it prints user unfriendly output.
# Note, with Ubuntu Gusty (8.04), there are two versions of mt,
# so we attempt to figure out which one.
+# Note, with mt GNU cpio, we use "drive status" output
#
OS=`uname`
@@ -84,6 +85,11 @@ case ${OS} in
if test $? -eq 1 ; then
ready="drive status"
fi
+ else
+ mt --version|grep "GNU cpio" >/dev/null 2>&1
+ if test $? -eq 0 ; then
+ ready="drive status"
+ fi
fi
;;
esac