Stopping Buffering

To stop the buffering process, first stop all programs that use the PI-API. On Windows, if the interface services have been made dependent on the buffer server, they must stop first before the buffer server will stop. The control panel may be used to stop the interfaces and buffer server. Also, the pistop.bat file may be used. The sitestop.bat file should be modified to contain the interface stop commands.

Then use the bufutil program to stop the buffering process. This can be done either by running bufutil interactively and selecting the option to shutdown the sever or by running bufutil from the command prompt with a -k argument.

When the process shuts down, it will forward or store the contents of its memory buffers so that data is not lost.

An example of a script that checks to see that an interface is stopped on UNIX nodes is given here.

###############################################################################

# (#)sitestop 1.3 2000/07/25

# File: sitestop

#

# This file is provided to allow site specific applications to be stopped

# whenever the pistop is executed. An appropriate application start script

# should be inserted into the sitestart file or the verify_stopped()

# routine below may be used.

#

###############################################################################

## Boure shell script to check process shutdown.

verify_stopped()

{

pid=`ps -e | grep $1 | grep -v grep | awk '{ print $1 }'`

if [ ${pid:-0} -gt 0 ]

then

# Change the following line a signal besides SIGTERM is used to stop

# the interface.

kill $pid 

lcount=0 

dcount=0 

while [ ${pid:-0} -gt 0 ] 

do 

if [ ${lcount} -gt 300 ] 

then 

break; 

fi 

sleep 1 

echo '.\c' 

pid=`ps -e | grep $1 | grep -v grep | awk '{ print $1 }'` 

lcount=`expr $lcount+1` 

dcount=`expr $dcount+1` 

if [ ${dcount} -ge 60 ] 

then 

echo $lcount 

dcount=0 

fi 

done 

if [ ${dcount} -gt 0 ] 

then 

echo ' ' 

fi 

 

if [ ${pid:-0} -gt 0 ] 

then 

echo "ERROR: Unable to stop $1 (pid = $pid)" 

$PIHOME/bin/shootq "ERROR: Unable to stop $1 (pid = $pid)" 

else 

echo "Program $1 stopped" 

$PIHOME/bin/shootq "Program $1 stopped" 

fi 

else

echo "Program $1 not found" 

$PIHOME/bin/shootq "Program $1 not found" 

fi

 

}

 

# EXAMPLE:

# verify_stopped buftest

Enabling Operational Intelligence