#! /bin/sh # Simple script to encapsulate starting the myriad background # processes necessary for running any JavaSpaces program. # Each subordinate launching script invokes a process (either java or # rmid, into the background) and echoes its pid to the caller. We don't # use backquoted invocation to assign the echo'd pid directly to a shell # variable because the backquoted command does not return until the # background process exits. Instead we use simple temp files. PID=/tmp/.${LOGNAME}-$$.pid \rm -f $PID ServerPort=@tonic_server_port@ SpaceName=@tonic_space_name@ if [ "$TONICRC" = "" ] ; then TONICRC=$HOME/.tonicrc fi if [ -f $TONICRC ] ; then . $TONICRC fi ServerProcs=/tmp/tonicSession.$ServerPort if [ -f $ServerProcs ] ; then echo "A space appears to already be running on this machine." echo "Check the $ServerProcs file for more information." exit 1 fi # Delete those hungry .jar cache files from /tmp and such for tmp in /var/tmp /tmp ; do \rm -f $tmp/jar_cache* done jsPids="" echo "Starting HTTP server to furnish JINI/JavaSpaces class files..." startWeb > $PID pid=`cat $PID` jsPids="$jsPids $pid" echo " ... process id is $pid" sleep 2 echo "Starting rmid..." startRmi > $PID pid=`cat $PID` # Note that we DO NOT need to remember the rmid pid here, since we can # use the rmid -port -stop command to gracefully bring it down echo " ... process id is $pid" sleep 2 echo "Starting Jini lookup server ..." startLookup > $PID pid=`cat $PID` jsPids="$jsPids $pid" echo " ... process id is $pid" sleep 2 if [ "" != "" ] ; then echo "Starting transaction manager..." startTxnMgr > $PID pid=`cat $PID` jsPids="$jsPids $pid" echo " ... process id is $pid" sleep 2 else echo "Transaction mgr not configured ..." echo " ... will not be started" fi echo "Starting JavaSpaces ..." startJs > $PID pid=`cat $PID` jsPids="$jsPids $pid" echo " ... process id is $pid" umask 000 echo "$jsPids" > $ServerProcs echo "The $SpaceName space was launched at `date` by $LOGNAME " >> $ServerProcs \rm $PID exit 0