#! /bin/sh # # $Id: nmc_preremove.SunOS,v 1.2 2006/09/22 18:01:15 grands1 Exp $ Copyright (c) 1999-2006 EMC Corporation. # # # Copyright (c) 1999-2006 EMC Corporation. # # All rights reserved. This is an UNPUBLISHED work, and # comprises proprietary and confidential information of EMC. # Unauthorized use, disclosure, and distribution are strictly # prohibited. Use, duplication, or disclosure of the software # and documentation by the U.S. Government is subject to # restrictions set forth in a license agreement between the # Government and EMC or other written agreement specifying # the Government's rights to use the software and any applicable # FAR provisions, such as FAR 52.227-19. # # # Function: # gstpid # # Description: # Checks if a gstd instance exists and returns its pid. # # Arguments: # # Parameter Purpose # ---------------------- -------------------------------------------- # # Returns: # # Return Variable Purpose # ---------------------- -------------------------------------------- # result The pid of a gstd instance, or nil. # # Notes: # gstpid() { result=`/usr/bin/ps -e | awk '$4~/^gstd$/{print $1}'` } # # Function: # killproc # # Description: # Kills a process and then waits for it to die. # # Arguments: # # Parameter Purpose # ---------------------- -------------------------------------------- # $1 The PID to kill. # $2 Name of process to kill. # # Returns: # # Return Variable Purpose # ---------------------- -------------------------------------------- # # Notes: # killproc() { pid=$1 kill -TERM $pid while true ; do pid=`/usr/bin/ps -e | awk '$4~/^gstd$/{print $1}'` if [ -n "$pid" ] ; then sleep 1 else break fi done } # main PATH=/usr/sbin:/usr/bin:/sbin # shutdown running gstd gstpid if [ -n "$result" ] ; then if [ -f /etc/init.d/gst ]; then /etc/init.d/gst stop else echo "Shutting down gstd" killproc $result gstd fi fi # Make a copy of gstd.conf, can be used in upgrade cp $BASEDIR/etc/gstd.conf $BASEDIR/etc/.gstd.conf.$VERSION # Delete any localization files if [ "$PKGINST" = "SUNWebsg" ]; then $BASEDIR/bin/gst_localize REMOVE EBS else $BASEDIR/bin/gst_localize REMOVE fi #Delete the data source LD_LIBRARY_PATH=$BASEDIR/sybasa/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH $BASEDIR/sybasa/bin/dbdsn -y -d "lgto_gst" # Prepare message file to be shown by postremove cat >/tmp/.LGTObgst.msg <