3 # Stop pmcd and check no pmdas are still running.
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard filters
16 signal
=$PCP_BINADM_DIR/pmsignal
17 status
=1 # failure is the default!
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20 # real QA test starts here
23 # Useful definitions...
24 DEADLIMIT
=120 # seconds
27 # Debugging controls...
28 CMND
=$seq # already done for us
29 DBUG
=${DBUG:-FALSE} # normally, the name of this script, $0
30 DBUGLVL
=${DBUGLVL:-1} # normally set to 1
32 # Requires common.product:
35 linux|darwin|solaris|freebsd
)
36 AMTIME1970PROG
="date +%s"
39 if [ -x /usr
/etc
/amtime1970
]
41 AMTIME1970PROG
=/usr
/etc
/amtime1970
43 echo "Unknown platfrom $PCP_PLATFORM"
50 if [ $# -gt 1 -a "$DBUG" != FALSE
-a "$DBUG" = "$CMND" -a "$DBUGLVL" -ge "$1" ]
65 DEADSTART
=`$AMTIME1970PROG`
67 while [ "$NUMPROC" -gt 0 -a $DEADTIME -lt $DEADLIMIT ]
70 NUMPROC
=`ps -eo "args pid" | $PCP_AWK_PROG '
71 /^\/var\/pcp\/pmdas\/.*pmda.*/ { print $NF," ",$1 }
73 DEADTIME
=`$AMTIME1970PROG`
74 DEADTIME
=`expr $DEADTIME - $DEADSTART`
82 dbugEcho
1 "Shutting down PCP"
83 $sudo sh
$PCP_RC_DIR/pcp stop
>/dev
/null
&
85 # Wait for PMDAs with sprocs to exit.
86 dbugEcho
1 "Waiting until PCP is dead"
90 echo 1>&2 "$seq: unable to determine current time of day"
93 if [ "$SDTIME" -ge $DEADLIMIT ]
95 echo 1>&2 "$seq: PCP could not be shut down after $DEADLIMIT seconds"
98 dbugEcho
1 "PMDAs took $SDTIME second(s) to shut down"
102 # really make sure the "$PCP_RC_DIR/pcp stop" is complete, so it does
103 # not terminate the pmcd we're going to start
105 $sudo $signal -a pmcd
>/dev
/null
2>&1
110 dbugEcho
1 "Recovering after $BREATHER seconds"
113 dbugEcho
1 "Starting up PCP"
114 $sudo sh
$PCP_RC_DIR/pcp restart
>/dev
/null
118 # success or failure, we've finished
119 status
=`expr $status - 1`