#!/bin/ksh TCL=/usr/common/tcl8.3.1 PKG=/home/north/www-etc/sgi.mips3/lib WWW=/home/north/cgi-bin/webdot1.7.11/ PATH=$TCL/bin:/usr/sbin:$PATH HTTPHEADER="Content-Type: text/plain\n\n" export LD_LIBRARY_PATH=$TCL/lib:$LD_LIBRARY_PATH export TCLLIBPATH=$PKG/lib export DOTFONTPATH=/home/north/www-etc/lib/fonts/dos/windows/fonts/ function except { code=$(kill -l $?) case $code in EXIT) exit ;; *) print $HTTPHEADER print "WebDot server died with $code\n" print "Your request was: ${PATH_INFO:1}\n" print "Webdot server resource limits are:\n" ulimit -a exit ;; esac } # set resource limits to protect web server ulimit -c 0 # no core files ulimit -t 10 # CPU seconds max ulimit -v 500000 # 500 megs of virtual memory ulimit -f 8192 # 8192 * 512 = 4meg files trap 'except' XCPU XFSZ SEGV ERR ncpu=`hinv -c processor | sed "s/ .*//p 1q"` case $ncpu in 0|1) cpu=0 ;; 2|3) cpu=1 ;; *) cpu=$((RANDOM % (ncpu / 2) + 1)) ;; esac runon $cpu tclsh $WWW/webdot.tcl exit