File:  [TIS-4000 Rel T60] / scripts / stop_TIS
Revision 1.5: download - view: text, annotated - select for diffs
Fri Sep 29 17:29:45 2000 UTC (17 years, 2 months ago) by tis4000
Branches: MAIN
CVS tags: SPR653, LMC_baseline, HEAD, Duluth_baseline
SPR 653
Enclose the kill statements in () so that if kill fails the script will continue to execute. - Steel

#!/usr/bin/csh
#
#	Shuts Down the TIS4000 software
#
set displays = (dm edd trendvu alarmvu alarmConfig dataVu TagvuClient snlvu snapedit LogReport OpNoteClient UddsEditor opNote tagvu tisPermissions)

set processes = (trendProcessor alarmConfig alarmvu dm edd dataVu trendvu snlvu TagvuClient snapedit alarmPrinter alarmMgr dbClient nameSrv chanAcq png2 tisTime LogReport tisCard dpa OpNoteClient UddsEditor opNote tagvu tisPermissions)

set done="false"
set answer=""
#set id = ""

foreach display ($displays)
  set fn=`/usr/bin/ps -ef | grep $display | grep -v vdm | grep -v sendmail | grep -v xdm | grep -v adm | grep -v grep | grep -v dmi | awk '{print $2}'`
  if ($#fn && $answer == "") then
    echo ""
    echo "There is an active display present on this system       -       $display."
    echo "If it is dm or alarmvu or trendvu or snapedit or tagvu and you answer yes, "
    echo "you will lose all of your graphics (dm), alarmvu, trendvu, snapedit, and tagvu displays."
    echo ""
    while ($answer != "yes" && $answer != "no")
	echo -n "Do you wish to continue? [yes/no]: "
	set answer=$<
    end
  endif
  if ($answer == "no") then
	exit 1
  else
	set answer=""
  endif
end

if ($answer == "yes" || $answer == "") then

  echo ""
  echo "****** Stopping TIS4000 and Background Processes ******"
  echo ""

  pushd /tis4000/tasks
  ./stopJava
  popd

  foreach process ($processes)
    set pid=`/usr/bin/ps -ef | grep $process | grep -v vdm | grep -v sendmail | grep -v xdm | grep -v adm | grep -v grep | grep -v dmi | awk '{print $2}'`
    if ($#pid) then
      echo ""
      echo "****** Shutting Down $process ******"
      echo ""
      if ($process == "oracleTrendProcessor" || $process == "dataVu" || $process == "alarmMgr" || $process == "dbClient" || $process == "trendProcessor" || $process == "dpa") then
        (kill -INT $pid)	
      else
	(kill $pid)
      endif
    endif
  end
#
# Use "trendServer" for non Oracle trending or "oracleTrendServer" for Oracle trending.
# set var="trendServer"
  set var="oracleTrendServer"
  set pid=`/usr/bin/ps -ef | grep $var | grep -v vdm | grep -v sendmail | grep -v xdm |grep -v xdm | grep -v adm | grep -v grep | awk '{print $2}'`
  echo "****** Waiting for trendServer Shutdown ******"
  echo "****** THIS MAY TAKE SEVERAL MINUTES ******"
  while ($done == "false")
    if ($#pid) then
	  set pid=`/usr/bin/ps -ef | grep $var | grep -v vdm | grep -v sendmail | grep -v xdm | grep -v adm | grep -v grep | awk '{print $2}'`
    else
	 set done="true"
    endif
  echo ""
  echo "******  Removing files from /tis4000/operators/logins ******"
  echo ""
  rm -f /tis4000/operators/logins/*
  end
  echo ""
  echo "****** Completed Stopping TIS4000 Background Processes ******"
  echo ""
else 
  exit 1
endif


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>