/var/lib/pcp/testsuite/212 is in pcp-testsuite 3.8.12ubuntu1.
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 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | #! /bin/sh
# PCP QA Test No. 212
# can I make pmdacisco dump core during exit()?
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
. ./localconfig
if [ $PCP_PLATFORM != irix ]
then
echo "This version of cisco PMDA does not use sprocs" >$seq.notrun
echo "$seq: [not run] `cat $seq.notrun`"
exit 0
fi
. ./common.product
. ./common.check
. ./common.filter
status=0
_needclean=true
signal=$PCP_BINADM_DIR/pmsignal
trap "_cleanup" 0 1 2 3 15
_cleanup()
{
if $_needclean
then
if [ "`echo $PMCD_LOG_DIR/core*`" != "$PMCD_LOG_DIR/core*" ]
then
file $PMCD_LOG_DIR/core*
fi
rm -f $tmp.*
$sudo ex - $PCP_PMCDCONF_PATH <<End-of-File
g/^#$seq#.*pmdacisco/s/^#$seq#//
w!
q
End-of-File
_needclean=false
$sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
_wait_for_pmcd
_wait_for_pmlogger
fi
exit $status
}
# real QA test starts here
status=1
$sudo rm -f $PMCD_LOG_DIR/core*
echo "SIGINT to pmdacisco parent ..."
for i in 1 2 3
do
for j in 1 2 3 4 5
do
pid=`ps $PCP_PS_ALL_FLAGS | grep pmdacisco | grep -v grep \
| $PCP_AWK_PROG '
{ pid[$2]++; ppid[$3]++; next }
END { for (p in pid) {
for (pp in ppid) {
if (p == pp) {
print p
exit
}
}
}
}'`
[ ! -z "$pid" ] && break
sleep 1
done
if [ -z "$pid" ]
then
echo "Arrgh ... no pmdacisco parent process?"
ps $PCP_PS_ALL_FLAGS | grep pmdacisco
exit
fi
$sudo $signal -s TERM $pid
sleep 5
[ "`echo core*`" != "core*" ] && _cleanup
echo "Restart with SIGHUP"
$sudo $signal -a -s HUP pmcd
sleep 5
done
echo "SIGINT to pmdacisco sproc ..."
for i in 1 2 3
do
pid=`ps $PCP_PS_ALL_FLAGS | grep pmdacisco | grep -v grep \
| $PCP_AWK_PROG '
{ pid[$2]++; ppid[$3]++; next }
END { for (p in pid) {
fail=0
for (pp in ppid) {
if (p == pp) {
fail=1
break
}
}
if (fail == 0) {
print p
exit
}
}
}'`
if [ -z "$pid" ]
then
echo "Arrgh ... no pmdacisco sproc process?"
ps $PCP_PS_ALL_FLAGS | grep pmdacisco
exit
fi
$sudo $signal -s TERM $pid
sleep 5
[ "`echo $PMCD_LOG_DIR/core*`" != "$PMCD_LOG_DIR/core*" ] && _cleanup
echo "Restart with SIGHUP"
$sudo $signal -a -s HUP pmcd
sleep 5
done
echo
echo "start pmcd ..."
for i in 1 2 3
do
rm -f $PMCD_LOG_DIR/core*
if [ $1 -eq 1 ]
then
$sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
else
$sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
fi
_wait_for_pmcd
[ "`echo $PMCD_LOG_DIR/core*`" != "$PMCD_LOG_DIR/core*" ] && _cleanup
done
echo
echo "stop pmcd ..."
for i in 1 2 3
do
$sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
_wait_for_pmcd
rm -f $PMCD_LOG_DIR/core*
$sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
[ "`echo $PMCD_LOG_DIR/core*`" != "$PMCD_LOG_DIR/core*" ] && _cleanup
done
$sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
_wait_for_pmcd
echo
for i in 1 2 3
do
echo "[pass $i] configure pmdacisco and notify pmcd ..."
$sudo ex - $PCP_PMCDCONF_PATH <<End-of-File
g/^#$seq#.*pmdacisco/s/^#$seq#//
w!
q
End-of-File
$sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
_wait_for_pmcd
echo "[pass $i] unconfigure pmdacisco and notify pmcd ..."
$sudo ex - $PCP_PMCDCONF_PATH <<End-of-File
g/^[^#].*pmdacisco/s/^/#$seq#/
w!
q
End-of-File
rm -f $PMCD_LOG_DIR/core*
$sudo $signal -a -s HUP pmcd
[ "`echo $PMCD_LOG_DIR/core*`" != "$PMCD_LOG_DIR/core*" ] && _cleanup
done
echo
echo "all done ..."
status=0
exit
|