2 # @(#)sfs_mcr 2.1 97/10/23
5 # Copyright (c) 1992-1997,2001 by Standard Performance Evaluation Corporation
7 # Standard Performance Evaluation Corporation (SPEC)
8 # 6585 Merchant Place, Suite 100
10 # This product contains benchmarks acquired from several sources who
11 # understand and agree with SPEC's goal of creating fair and objective
12 # benchmarks to measure computer performance.
14 # This copyright notice is placed here only to protect SPEC in the
15 # event the source is misused in any manner that is contrary to the
16 # spirit, the goals and the intent of SPEC.
18 # The source code is provided to the user or company under the license
19 # agreement for the SPEC Benchmark Suite for this product.
21 # *****************************************************************
23 # * Copyright 1991,1992 Legato Systems, Inc. *
24 # * Copyright 1991,1992 Auspex Systems, Inc. *
25 # * Copyright 1991,1992 Data General Corporation *
26 # * Copyright 1991,1992 Digital Equipment Corporation *
27 # * Copyright 1991,1992 Interphase Corporation *
28 # * Copyright 1991,1992 Sun Microsystems, Inc. *
30 # *****************************************************************
32 # Usage sfs_mcr <sfs parameter string>
34 # Teelucksingh - Creation (6/17/91)
36 # This script is remotely started from the Prime-client
43 SFS_PNT_PID="/tmp/sfs_pnt_pid"
44 SFS_SYNCD_PID="/tmp/sfs_syncd_pid"
46 # SFS client log files
47 CLIENT_LOG_FILES="/tmp/sfs_CL$CLIENT_NUM \
48 /tmp/sfs_sig$CLIENT_NUM \
49 /tmp/sfs_x$CLIENT_NUM"
51 if [ "$1" = "cleanup" ]; then
55 rm -f $CLIENT_LOG_FILES
58 # clean up any 'old' sfs processes
60 if [ -f $SFS_PNT_PID ]; then
61 kill -2 `cat $SFS_PNT_PID` > /dev/null 2>&1
64 if [ -f $SFS_SYNCD_PID ]; then
65 kill -2 `cat $SFS_SYNCD_PID` > /dev/null 2>&1
72 # read command line arguments
85 echo "========================================================================" >> $C_LOGFILE
89 # decide whether to use BSD (which one) or SYSV variant of commands
91 # do test to see whether to use hostname or uname
92 sh -c "hostname > /dev/null 2>&1" > /dev/null 2>&1
94 HOSTNAME_CMD="hostname"
96 sh -c "uname -n > /dev/null 2>&1" > /dev/null 2>&1
98 HOSTNAME_CMD="uname -n"
100 echo "sfs_mcr: can't use hostname(1) or uname(1), exiting." >> $C_LOGFILE
106 # trap for signals used by sfs
108 # Try to find cpp in the common places, if not there then let PATH find it
114 elif [ -f /usr/ccs/lib/cpp ]
123 # Allow trap numbers to be defined externally for broken systems
125 if [ "$TRAP_NUMS" = "" ]
127 echo "#include <signal.h>" > /tmp/sfs_sig$CLIENT_NUM
128 echo "myprint SIGINT SIGALRM SIGTERM SIGUSR1 SIGUSR2" >> \
129 /tmp/sfs_sig$CLIENT_NUM
130 cat /tmp/sfs_sig$CLIENT_NUM | $CPP | grep myprint | \
131 awk '{print $2 " " $3 " " $4 " " $5 " " $6}' > /tmp/sfs_x$CLIENT_NUM
132 TRAP_NUMS=`cat /tmp/sfs_x$CLIENT_NUM`
137 # start the sync daemon on the client
139 # Let's truncate the syncd log file at the start of each invocation
140 # of sfs_mcr. Else it grows unbounded.
143 $SFS_DIR/sfs_syncd > $S_LOGFILE 2>&1 &
144 echo "Started: sfs_syncd on client (`$HOSTNAME_CMD`). " >> $C_LOGFILE
149 echo "Starting: $SFS_DIR/$SFS_PROG -N $CLIENT_NUM $*" >> $C_LOGFILE
151 $SFS_DIR/$SFS_PROG -N $CLIENT_NUM $* >> $C_LOGFILE 2>&1
153 if [ $? -ne 0 ]; then # error condition
155 echo "sfs_mcr: sfs benchmark terminated with error status" >>$C_LOGFILE
159 # clean up any 'old' sfs processes
161 if [ -f $SFS_PNT_PID ]; then
162 kill -2 `cat $SFS_PNT_PID` > /dev/null 2>&1
165 if [ -f $SFS_SYNCD_PID ]; then
166 kill -2 `cat $SFS_SYNCD_PID` > /dev/null 2>&1