#!/bin/ksh # A simple script to gather up all the lib's referenced from a core file # it bundles them up in a compressed tar file to be sent with the core file # to service team, inorder to be used with the edit_core cmd. # # This needs the checkcore program as can be found on javaserv # # It outputs a file called core-libs.tar.Z # # Author: Ben Hardill # email : hardillb@uk.ibm.com # version: 0.1 09/12/2002 # updated: 1/8/2002 Roger Leuckie -> embedded checkcore # # # if checkcore does not exist in current directory # then create it # if [ ! -f ./checkcore ]; then touch -am 1231235999 $$.touch >/dev/null 2>&1 if test ! -f 1231235999 && test -f $$.touch; then shar_touch=touch else shar_touch=: echo 'WARNING: not restoring timestamps' fi rm -f 1231235999 $$.touch # # ============= checkcore ============== if test -f 'checkcore' && test X"$1" != X"-c"; then echo 'x - skipping checkcore (File already exists)' else echo 'x - extracting checkcore (binary)' sed 's/^X//' << 'SHAR_EOF' | uudecode && begin 600 checkcore M`=\`!#F]#1<```````````!($`'RP M*WA\'O@`D<(``)'B``2",0``@4(`+#D@``!E*00#+1$``)$J``!`@@`02``` MD6````!(```4@^(`.$@``9&`00`4?&X;>$&*`!R`$0``D$$`%'P)`Z:`40`$ M3H`$(8!!`!2`X@!`.0```'W#)$'``!(``D18````(#B`"`L M!P``08(`"(!B`"1(``U)@$$`%'R!"`@```````P@0`````````"L``=?7W-T M87)T````?`@"IH!B``B4(?_`D$$`%)`!`$B``@`,+(,``(""`#`L````@*,` M`(%C``A!@@`(D`0``'RH`Z9!A@"@@$,`!$Z``"&`00`4@&(`$"P#``"``P`` M@6,`"'P(`Z9!@@`0@$,`!$Z``"&`00`4@&(`%"P#``"``P``@6,`"'P(`Z9! M@@`0@$,`!$Z``"&`00`4@&(`&"P#``"``P``@6,`"'P(`Z9!@@`0@$,`!$Z` M`"&`00`4@&(`'"P#``"``P``@6,`"'P(`Z9!@@`0@$,`!$Z``"&`00`4@8$` M2#@A`$!]B`.F3H``(````````"!!@````````.@`#E]?=&AR96%D(-A`%R#@0!@."$`<'V(`Z8X8``!@^'__$Z``""`8@!(@`,` M`"P```$L@``"+P```T&"`TQ!A@,\09H`/(!B`$R`@@!0.(0`L#AC`$!(``>Q M@$$`%(&!`'B#80!<@X$`8#@A`'!]B`.F.&```8/A__Q.@``@@&(`6(/#`!2` M80!$.(```#B@``!(``>=@$$`%(!A`$1CQ```.*```$@`!XF`00`4@&$`1&.$ M``!C90``2``'G8!!`!1\`]A`08(`+(!B`%`X8P!`2``'K8!!`!2!@0!X."$` M<+MA_^Q]B`.F.&```4Z``""#P@!H@!X``"P```!!@@`X8YT``(."`&R#8@!P M@R(`=#M```&`G```@!X``"P$``"0FP``.'@`&"R```!!@@!\2```-&.8``"# M@@!L@V(`<(,B`'0[0``!@)P``(`>```L!```D)L``#AX`!@L@```08(`2("$ M``1!A@`(.'T`,$@`!T5@````+`,``(`>```X>``8+(```$&"`!B`FP``@(0` M#)";```L!```2___Q"P:``!(```(+!\``("<```X8``00((!#"P$``!!@@`\ M2``&'8!!`!2`G```D&0`"(!\``"`@P`(D&0`#(!\``"`@P`(D)P``"P$```X M?0`P08(`<$@``"1(``7E@$$`%)!\``!@9```D'D``"P$```X?0`P08(`3(`> M```L````08(`*$@`!\&`00`4@)P``)!D``"`G```@&0``"P#``!!@@"`2``` M*#AX`!A(``>9@$$`%("<``"09```@)P``(!D```L`P``08(`6$@`!7&`00`4 M@+P``#B=`#"090`$@!X``(!\```L````@&,`!$&"`"!(``>!8````("<``"` M'@``+(```$&&`#1(```@.)@`&$@`!V%@````@)P``(`>```L@```088`%(`= M``!\```T5`#9?T@``!"`&```?```-%0`V7]`@@`X088`$(`=``!_O0(52``` M#(`8``!_&`(508(`'(`>```L!```D)L``#AX`!@L@```2__^1(!B`%`L!``` M@(0`!$&"`&1(``?M@$$`%(!\``"`8P`$2``(!8!!`!2`?```@&,`#)!\``"` M8P`(2``'[8!!`!2`8@!0@)P``"P$``"`A``$08(`($O__[R`8@"(@\,`%$O_ M_02`8@",@\,`!$O__/@X8```@8$`>#@A`'"[`?_@?8@#IDZ``"`````````@ M08`(!0`````````#U``(^$&!`!1\I00P?.<$,'R%.$!(```$&"`""(Q```+`8``)C%```XA``!38(`(#BE``%"`/_H@.0``#"E M__Q\Z5`X?2E0%'TL4/E`@@`TA00`!)3E``1]"5`X?2E0%'TL4/E`@@`LA.0` M!)4%``1\Z5`X?2E0%'TL4/E!@O_0?2DX^'TI4'E!@O_$2```%'TI0/A]*5!Y M08+_S'T'0W@XI0`#=.;_`%3G0#Z`````$?```" M(``/?`````$?```"(``0:``````?```"(``0;`````$?```"(``0<``````? M```"(``0=`````$?```"(``0I`````(?```"(``0J````!(?```"(``0K``` M`!,?```"(``0L`````$?```"(``0M`````$?```"(``0N````!$?```"(``0 MO`````,?```"(``0P`````H?```"(``0Q`````(?```"(``0R`````7-T96U?8V]N9FEG=7)A=&EO;@``"U]?;6]D D7VEN:70``!M?7VUA;&QO8U]U/dev/null 2>&1; exit 1" 2 # look for checkcore if ! [ -e ./checkcore ] ; then echo "[WARNING]: can not find checkcore" >&2 exit 1; fi # look for checkcore if ! [ -x ./checkcore ] ; then echo "Can not execute checkcore" exit 1; fi #make temp dir if ! [ -e $libsdir ] ; then mkdir $libsdir else echo $libsdir already in existance exit 1 fi #look for corefile name if ! [ -n $1 ]; then coreFile='core' else coreFile=$1 fi if [ -z "${EXECNAME}" ]; then echo "Determine executable ..." strings ${coreFile} | egrep "_=" 2>/dev/null | cut -d= -f2 | head -1 | read FULLNAME if [ -n "${FULLNAME}" ]; then export PATH="${FULLNAME%/*}:${PATH}" export EXECNAME="${FULLNAME##*/}" echo "Executable = ${FULLNAME}" fi fi echo "Using : $( which ${EXECNAME:-java} )" echo "(if not correct, please change PATH variable)" echo "Grabbing the active libs from core file" for file in $(./checkcore $coreFile) $( which ${EXECNAME:-java} ) do echo $file if [ ! -e ${file} ]; then ofile="${file}" file="$( whence ${file} )" if [ -z "${file}" ]; then file="${ofile}" fi fi if [ -e $file ]; then cp $file $libsdir else echo "Can not find $file" fi done home=$PWD cd $libsdir tar cf - * | compress > $home/core-libs.tar.Z cd $home rm -rf $libsdir