#!/bin/sh # # remake the big1 archive. # Needs a lot of disk space, so is guarded by df check ... output # archive is used by multiple tests. If return code is non-zero, # then output is suitable for a notrun message. # # Copyright (c) 2012 Red Hat. # Copyright (c) 2011 Ken McDonell. All Rights Reserved. # [ -f ../common.rc ] && cd .. # from src directory . ./common.rc # for $sudo, $tmp, $here and pcp.env . ./common.check # cleanup any archives in the old location (not src) $sudo rm -f big1.* # don't recreate the archive unless we really have to [ -s src/big1.0 -a -s src/big1.1 -a -s src/big1.index -a -s src/big1.meta ] && exit 0 # 10GB should keep us out of trouble free=`_check_freespace 10240` if [ -n "$free" ] then echo $free exit 1 fi status=1 iam=mkbig1 $sudo rm -rf $tmp.* trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 _cleanup() { if [ ! -f $tmp.done ] then cd $here/pmdas/bigun $sudo ./Remove >>$here/src/$iam.log cd $here touch $tmp.done fi } cd $here/pmdas/bigun make >$here/src/$iam.log 2>&1 $sudo ./Install >$here/src/$iam.log if [ $? != 0 ] then echo "bigun pmda Install failed ... see $here/src/$iam.log" exit fi if pmprobe bigun 2>&1 | tee -a $here/src/$iam.log | grep ' [0-9]$' then : else echo "bigun pmda Install failed ... see $here/src/$iam.log" exit fi cd $here cat <$tmp.config log mandatory on default { bigun sample.hordes } End-of-File $sudo rm -f big1.* pmlogger -r -c $tmp.config -l $tmp.out -t 10msec -s 2049 src/big1 echo >>$here/src/$iam.log cat $tmp.out >>$here/src/$iam.log echo >>$here/src/$iam.log ls -l src/big1.* >>$here/src/$iam.log status=0 exit