File: mkbig1

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (80 lines) | stat: -rwxr-xr-x 1,836 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/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 tmparch directory
. ./common.rc	# for $sudo, $tmp, $here and pcp.env
. ./common.check

# cleanup any archives in the old location (not tmparch)
$sudo rm -f big1.*

# don't recreate the archive unless we really have to
[ -s tmparch/big1.0 -a -s tmparch/big1.1 -a -s tmparch/big1.index -a -s tmparch/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/tmparch/$iam.log
	cd $here
	touch $tmp.done
    fi
}

cd $here/pmdas/bigun
make >$here/tmparch/$iam.log 2>&1
$sudo ./Install </dev/null >>$here/tmparch/$iam.log
if [ $? != 0 ]
then
    echo "bigun pmda Install failed ... see $here/tmparch/$iam.log"
    exit
fi
if pmprobe bigun 2>&1 | tee -a $here/tmparch/$iam.log | grep ' [0-9]$'
then
    :
else
    echo "bigun pmda Install failed ... see $here/tmparch/$iam.log"
    exit
fi
cd $here

cat <<End-of-File >$tmp.config
log mandatory on default {
    bigun
    sample.hordes
}
End-of-File

$sudo rm -f big1.*
# Needs to be a V2 archive to trigger the volume switch at 2Gb
#
pmlogger -V2 -r -c $tmp.config -l $tmp.out -t 10msec -s 2049 tmparch/big1
echo >>$here/tmparch/$iam.log
cat $tmp.out >>$here/tmparch/$iam.log
echo >>$here/tmparch/$iam.log
ls -l tmparch/big1.* >>$here/tmparch/$iam.log

status=0
exit