This file is indexed.

/var/lib/pcp/testsuite/793 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/sh
# PCP QA Test No. 793
# pmlogger_check and pmlogger_daily with shell components in the dir field
# of the control file
#
# Copyright (c) 2015 Ken McDonell.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

status=1	# failure is the default!
$sudo rm -rf $tmp.* $seq.full
trap "cd $here; rm -rf $tmp.*; _cleanup; exit \$status" 0 1 2 3 15
signal=$PCP_BINADM_DIR/pmsignal

_filter()
{
    sed \
	-e 's/\.\.\.*/[dots]/' \
	-e "s/$FULLLOCALHOST/LOCALHOST/g" \
	-e "s/$LOCALHOST/LOCALHOST/g" \
	-e "s/localhost/LOCALHOST/g" \
	-e "s/local:/LOCALHOST/g" \
	-e 's/control:[0-9][0-9]*]/control:LINE]/' \
	-e 's;/usr/var;/var;g' \
	-e "s;$tmp;TMP;g" \
	-e '/Duplicate/d' \
	-e '/Roll [^ ]*\/NOTICES /d' \
	-e '/Start new [^ ]*\/NOTICES$/d' \
	-e '/Restarting/s/process [0-9][0-9]*/process PID/' \
	-e '/Looking for pmlogger/s/process [0-9][0-9]*/process PID/' \
	-e '/Terminating pmlogger/s/process [0-9][0-9]*/process PID/' \
	-e '/^pmlogger \[/{
s/\[[0-9][0-9]*/[PID/
s/from host .*/from host .../
}' \
	-e '/Latest folio created/s/ [0-9][0-9][0-9][0-9][01][0-9][0-3][0-9]\.[0-5][0-9]\.[0-5][0-9]/ DATE.TIME/' \
	-e '/^pmlogger -m/s/ [0-9][0-9][0-9][0-9][01][0-9][0-3][0-9]\.[0-5][0-9]\.[0-5][0-9]/ DATE.TIME/' \
	-e '/^pcp /s/ .*/ .../' \
	-e '/^PMCD host /s/host .*/host .../' \
	-e '/^log started /s/started .*/started .../' \
	-e '/^last log entry /s/entry .*/entry .../' \
	-e '/^current time /s/time .*/time .../' \
	-e '/^log size /s/size .*/size .../' \
    | _filter_cron_scripts
}

_stop_loggers()
{
    $sudo $signal -a -s TERM pmlogger
}

_cleanup()
{
    echo
    echo "Cleaning up"

    _stop_loggers >/dev/null 2>&1

    cd # get out of tmp directory so we can delete it
    $sudo rm -rf $tmp

    $sudo $PCP_BINADM_DIR/pmlogger_check
    _wait_for_pmlogger
}

_setup()
{
    _stop_loggers >/dev/null 2>&1
    cd
    rm -rf $tmp
    mkdir $tmp
    qatmp=$tmp
    export qatmp
}

cat >$tmp.config <<End-of-File
log mandatory on 1 sec {
    hinv.ndisk
    hinv.ncpu
}
End-of-File

# real QA test starts here

_setup

# control file
#
cat >$tmp/control <<End-of-File
\$version=1.1
\$A=A
#
# $qatmp from the caller's environment
# $A from the control file above
LOCALHOSTNAME	n   n	\$qatmp/\$A -c $tmp.config
LOCALHOSTNAME	n   n	\$(echo $qatmp/B) -c $tmp.config
LOCALHOSTNAME	n   n	"$qatmp/\`echo c | tr '[a-z]' '[A-Z]'\`" -c $tmp.config
End-of-File

echo "pmlogger_check #1" | tee -a $here/$seq.full
$sudo $PCP_BINADM_DIR/pmlogger_check -V -c $tmp/control -l $tmp/log
[ -s $tmp/log ] && $sudo cat $tmp/log | tee -a $here/$seq.full | _filter
for x in A B C
do
    ls $tmp/$x >>$here/$seq.full
    echo `ls $tmp/$x | grep "\.meta" | wc -l | sed -e 's/ //g'` archives in TMP/$x
done

sleep 2
_stop_loggers >/dev/null 2>&1

echo "pmlogger_check #2" | tee -a $here/$seq.full
$sudo $PCP_BINADM_DIR/pmlogger_check -V -c $tmp/control -l $tmp/log
[ -s $tmp/log ] && $sudo cat $tmp/log | tee -a $here/$seq.full | _filter
for x in A B C
do
    ls $tmp/$x >>$here/$seq.full
    echo `ls $tmp/$x | grep "\.meta" | wc -l | sed -e 's/ //g'` archives in TMP/$x
done

echo
echo "pmlogger_daily"
$sudo $PCP_BINADM_DIR/pmlogger_daily -V -x never -c $tmp/control -l $tmp/log
[ -s $tmp/log ] && $sudo cat $tmp/log | tee -a $here/$seq.full | _filter
for x in A B C
do
    ls $tmp/$x >>$here/$seq.full
    echo `ls $tmp/$x | grep "\.meta" | wc -l | sed -e 's/ //g'` archives in TMP/$x
done

# success, all done
status=0
exit