source: branches/samba-3.0/examples/scripts/debugging/solaris/solaris-oops.sh

Last change on this file was 1, checked in by Paul Smedley, 18 years ago

Initial code import

File size: 914 bytes
Line 
1#!/bin/sh
2#
3# solaris_panic_action -- capture supporting information after a failure
4#
5ProgName=`basename $0`
6LOGDIR=/usr/local/samba/var
7
8main() {
9 pid=$1
10
11 if [ $# -lt 1 ]; then
12 say "$ProgName error: you must supply a pid"
13 say "Usage: $0 pid"
14 exit 1
15 fi
16 cat >>$LOGDIR/log.solaris_panic_action <<!
17
18`date`
19State information and vountary core dump for process $pid
20
21Related processes were:
22`/usr/bin/ptree $pid`
23
24Stack(s) were:
25`/usr/bin/pstack $pid`
26
27Flags were:
28`/usr/bin/pflags $pid`
29
30Credentials were:
31`/usr/bin/pcred $pid`
32
33Libraries used were:
34`/usr/bin/pldd $pid`
35
36Signal-handler settings were:
37`/usr/bin/psig $pid`
38
39Files and devices in use were:
40`/usr/bin/pfiles $pid`
41
42Directory in use was:
43`/usr/bin/pwdx $pid`
44
45
46A voluntary core dump was placed in /var/tmp/samba_solaris_panic_action_gcore.$pid
47`gcore -o /var/tmp/samba_solaris_panic_action_gcore $pid`
48!
49}
50
51say() {
52 echo "$@" 1>&2
53}
54
55main "$@"
Note: See TracBrowser for help on using the repository browser.