/var/lib/pcp/testsuite/1108 is in pcp-testsuite 4.0.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | #! /bin/sh
# PCP QA Test No. 1108
# pv:821339 sed gives "Too many commands" in daily cron script
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
#
# check-group-exclude: pmlogger
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
_cleanup()
{
test -f $PCP_LOG_DIR/NOTICES.orig && \
$sudo mv $PCP_LOG_DIR/NOTICES.orig $PCP_LOG_DIR/NOTICES
$sudo rm -f $tmp.*
}
status=0 # success is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $seq.full
_filter()
{
sed \
-e '/^+ cd /s/cd .*/cd .../' \
-e '/^+ mv /s/mv .*/mv .../' \
-e '/^+ pmlogger /s/pmlogger .*/pmlogger .../' \
-e '/^+ pmnewlog /s/pmnewlog .*/pmnewlog .../' \
-e '/^+ mkaf /s/mkaf .*/mkaf .../' \
-e '/^+ kill/{
s/INT //
s/-s USR1 //
s/ [0-9][0-9]*/ ... PID/
}' \
-e '/^+ rm /d' \
-e '/^+ pmlogger_merge /d' \
-e '/^[12][0-9][0-9][0-9][01][0-9][0-3][0-9]\.[0-9][0-9]\.[0-9][0-9]/d' \
-e '/Warning: no write access/d' \
-e 's/ *$//' \
| tr -s ' '
}
echo "pmlogger processes at the beginning ..." >>$seq.full
$PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep pmlogger >>$seq.full
# Avoid conflict with normal management of the summary logs ...
# this is lifted from pmlogger_daily
# each summarized log is named yyyymmdd using yesterday's date
# previous day's logs are named yymmdd (old format) or
# yyyymmdd (new year 2000 format)
#
SUMMARY_LOGNAME=`pmdate -1d %Y%m%d`
echo "SUMMARY_LOGNAME=$SUMMARY_LOGNAME" >>$seq.full
echo "Files to be removed before we start ..." >>$seq.full
ls -l $PCP_LOG_DIR/pmlogger/*/$SUMMARY_LOGNAME.* >>$seq.full 2>&1
$sudo rm -f $PCP_LOG_DIR/pmlogger/*/$SUMMARY_LOGNAME.*
# create a temporary control file with well-known contents
$sudo rm -f $tmp.control
echo '$version=1.1' >> $tmp.control
echo 'LOCALHOSTNAME y n PCP_LOG_DIR/pmlogger/LOCALHOSTNAME -c config.default' >> $tmp.control
# make sure pmlogger_daily gets a timestamp that is at least
# a minute after the previous primary logger was started to avoid
# the collision on the timestamp and the extra 3 mv's needed to
# rename the archive files from <timestamp> to <timestamp>-00
#
current=`pminfo -f pmcd.pmlogger.archive | sed -n -e '/"primary"/{
s;.*/;;
s/"//
p
}'`
if [ -z "$current" ]
then
echo "Arrgh ... cannot get current primary pmlogger timestamp from"
pminfo -f pmcd.pmlogger.archive
ls -l $PCP_RUN_DIR/pmlogger*
status=1
exit
fi
echo "current=$current" >>$seq.full
sec=0
while [ $sec -lt 60 ]
do
now=`pmdate %Y%m%d.%H.%M`
[ "$now" != "$current" ] && break
echo "now=$now" >>$seq.full
sleep 1
sec=`expr $sec + 1`
done
echo "done, now=$now" >>$seq.full
# real QA test starts here
test -f $PCP_LOG_DIR/NOTICES && \
$sudo mv $PCP_LOG_DIR/NOTICES $PCP_LOG_DIR/NOTICES.orig
$sudo $PCP_BINADM_DIR/pmlogger_daily -o -k 550 -N -c $tmp.control -l $tmp.log
$sudo cat $tmp.log \
| tee -a $seq.full \
| _filter
|