#! /bin/ksh
#
# This script runs the OrbixWeb daemon orbixdj on the localhost and registers
# the DOC servers.
#
# After starting it, the DOC server and tester are removed from registration,
# and re-registered using ~/rps2/control/new_controller/services/rmem and
# putem.  This will ensure that the server class path will be to your copy of
# the classes (well probably ensure's it).  
#
# (Note, that this procedure sets the single OrbixWeb repository to point to
#  your classes.  So, the next person who runs orbixdj, (outside this script)
#  will get the DOC server and tester in your area regardless of the node from
#  which they are running orbixdj.)
#
# This script must reside in the bin sub-directory of the DOC directory tree.

script_path=`whence $0` >/dev/null 2>&1
script_home=`dirname $script_path`

echo Starting OrbixWeb daemon on `hostname`...
$script_home/doc-orbixdj $* &

echo Waiting twenty seconds for daemon to start...
sleep 20

echo Removing DOC_REMOTE_SERVER and Service_Tester from OrbixWeb daemon...
$script_home/rmem  

echo Restoring DOC_REMOTE_SERVER and Service_Tester to OrbixWeb daemon...
$script_home/putem  

echo Checking DOC_REMOTE_SERVER classpath...
$script_home/doc-catit -h `hostname` DOC_REMOTE_SERVER
