]> git.sur5r.net Git - bacula/bacula/commitdiff
First attempt at using mdb on Solaris instead of dbx which isn't standard on most...
authorMarco van Wieringen <mvw@planets.elm.net>
Thu, 8 Apr 2010 16:50:51 +0000 (18:50 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:49:45 +0000 (16:49 +0200)
bacula/scripts/btraceback.in
bacula/scripts/btraceback.mdb [new file with mode: 0644]

index 1e7ae9e988117f2173bc5bcf5cb1dc2e70a71a3b..9b9a4882c73f151137aa1cb2b3bd6209302a9ee8 100755 (executable)
@@ -14,7 +14,11 @@ 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
+  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@
 else
diff --git a/bacula/scripts/btraceback.mdb b/bacula/scripts/btraceback.mdb
new file mode 100644 (file)
index 0000000..1e3f9aa
--- /dev/null
@@ -0,0 +1,24 @@
+# btraceback.mdb
+
+$G
+::echo "******** RUNNING LWPS/THREADS:"
+::echo
+::walk thread
+
+::echo
+::echo
+::echo "******** STACK TRACE OF CURRENT LWP:"
+::echo
+$C
+
+::echo
+::echo
+::echo "******** VARIABLES DUMP OF CURRENT LWP:"
+::echo
+
+::echo "******** STACK TRACE OF LWPS:"
+::walk thread | ::findstack
+
+::echo "******** VARIABLES DUMP OF LWPS:"
+
+::quit