diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-07 15:55:27 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-07 15:55:27 +0000 |
commit | ce788a2e70048a95f2619f69023d6c82a2ad42f7 (patch) | |
tree | 4f59ff9862a98e114b373ad1d62dc0f4d6956edc /TAO/examples | |
parent | 8c444d10c836dd191e838519a3a3be46b2a7bbfb (diff) | |
download | ATCD-ce788a2e70048a95f2619f69023d6c82a2ad42f7.tar.gz |
generate port numbers based on uid, and set TAO_ROOT if it's not set
Diffstat (limited to 'TAO/examples')
-rwxr-xr-x | TAO/examples/Simulator/ss | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/TAO/examples/Simulator/ss b/TAO/examples/Simulator/ss index 47ccfd823be..c2556b1dd77 100755 --- a/TAO/examples/Simulator/ss +++ b/TAO/examples/Simulator/ss @@ -1,31 +1,43 @@ -#!/bin/ksh +#!/bin/ksh +# $Id$ #saving old working dir old_dir=$cwd login=`whoami` +uid=`id -u` + +#### Set TAO_ROOT, if it wasn't set. +if [ ! "$TAO_ROOT" ]; then + if [ "$ACE_ROOT" ]; then + TAO_ROOT=$ACE_ROOT/TAO + else + echo $0: you must set ACE_ROOT or TAO_ROOT! + exit 1 + fi +fi echo // Killing the old services ps -ef | grep Service | grep $login | grep -v grep | cut -c10-17 > /tmp/pids$login if [ -s /tmp/pids$login ]; then - pids=`cat /tmp/pids$login` + pids=`cat /tmp/pids$login` kill $pids fi echo // Initializing the log file - + if [ -r /tmp/logfile_$login ]; then rm /tmp/logfile_$login fi echo // Logfile for the script "ss" which startes Name, Scheduling and Event Service > /tmp/logfile_$login -nameserviceport=10016 -schedulerserviceport=10021 -eventserviceport=10026 +nameserviceport=`expr 20023 + $uid` +schedulerserviceport=`expr 60023 + $uid` +eventserviceport=`expr 100023 + $uid` cd $TAO_ROOT/orbsvcs/Naming_Service ./Naming_Service -ORBport $nameserviceport >> /tmp/logfile_$login 2>&1 & @@ -39,18 +51,17 @@ echo // The IOR of the Naming Service: $IOR echo // Started Naming Service on port $nameserviceport cd $TAO_ROOT/orbsvcs/Scheduling_Service -Scheduling_Service -ORBnameserviceior $IOR -ORBport $schedulerserviceport >> /tmp/logfile_$login 2>&1 & +./Scheduling_Service -ORBnameserviceior $IOR -ORBport $schedulerserviceport >> /tmp/logfile_$login 2>&1 & sleep 1 echo // Started Scheduling Service on port $schedulerserviceport cd $TAO_ROOT/orbsvcs/Event_Service -Event_Service -ORBnameserviceior $IOR -ORBport $eventserviceport >> /tmp/logfile_$login 2>&1 & +./Event_Service -ORBnameserviceior $IOR -ORBport $eventserviceport >> /tmp/logfile_$login 2>&1 & cd $old_dir echo // Started Event Service on port $eventserviceport echo "// Enjoy the use ;-)" -ps -ef | grep Service | grep -v grep - +ps -ef | grep Service | grep -v grep |