UNIX Home Node Shutdown Events

The pistart.sh script should be modified to switch behavior between a system reboot and a PI server stop and start with buffering still running.

Add a new flag option of -reboot.

flag_sitestart=1

flag_minimal=0

flag_standardout=0

flag_basestart=0

flag_reboot=0

 

for CMDARG in $*

do

 case $CMDARG in

  I | *nosite )  flag_sitestart=0 ;;

  M )   flag_minimal=1 ;;

  *stdout )  flag_standardout=1 ;;

  *base )  flag_basestart=1 ;;

  *reboot )  flag_reboot=1 ;;

  *)   print "Unknown Command Argument" $CMDARG ;;

 esac

done

Then add conditional behavior for pishutev later in the script.

if (( flag_reboot == 1 ))

then

echo Adding PI Shutdown Events 

if [ -r `./piparams -pl`pishutev.log ] 

then 

 mv `./piparams -pl`pishutev.log `./piparams -pl`pishutev.log.old

fi 

`./piparams -pb`pishutev > `./piparams -pl`pishutev.log 2>&1 & 

else

`./piparams -pb`pishutev -f shutdownC.dat > `./piparams -pl`pishutevC.log 2>&1 & 

`./piparams -pb`pishutev -f shutdownG.dat > `./piparams -pl`pishutevG.log 2>&1 & 

`./piparams -pb`pishutev -f shutdownAT.dat > `./piparams -pl`pishutevAT.log 2>&1 & 

endif

Finally, the automatic startup scripts for the PI server need to be modified to pass the -reboot flag to the pistart.sh script.

#!/bin/ksh

#

# Filename: Pistart

#

if [ -f /opt/PI/adm/pistart.sh ] ; then

cd /opt/PI/adm 

nohup ksh pistart.sh -reboot 

fi

Enabling Operational Intelligence