#!/bin/sh # Installation instructions for Systems V # # copy the above script to /etc/rc.d/init.d # link it to a start and a stop file in each of the rc?.d directory # appropriate for the run level for which you wish the engine to be # started, eg # # $ ln -s /etc/rc.d/init.d/informix /etc/rc.d/rc3.d/S99informix # $ ln -s /etc/rc.d/init.d/informix /etc/rc.d/rc0.d/K01informix # $ ln -s /etc/rc.d/init.d/informix /etc/rc.d/rc6.d/K01informix # # Note: The following 2 lines below were added for Redhat Linux # pschmidt 8/8/99 # touch /var/lock/subsys/informix # Note: This line important for Linux # rm -f /var/lock/subsys/informix # Note: This line important for Linux export INFORMIXDIR=/u/informix7.30 export INFORMIXSERVER=vadv_shm export ONCONFIG=onconfig.vadv if [ $# -lt 1 ] then echo "Usage: $0 {start|stop}" else case "$1" in 'start_msg') echo "The Informix Online Engine is starting up..." ;; 'stop_msg') echo "The Informix Online Engine is shutting down..." ;; 'start') if [ `$INFORMIXDIR/bin/onstat 2>&- | grep -c "not initialized"` -ne 0 ] then /home/informix/bin/rotate_informix_logs.sh /home/informix/bin/rotate_informix_logical.sh echo -n "Starting up the Informix Online Engine... " $INFORMIXDIR/bin/oninit cnt=60 # Give informix 60 seconds to come online before giving up flag_online=false while [ $cnt -gt 0 ] do if [ `$INFORMIXDIR/bin/onstat 2>&- | grep -c "not initialized"` -eq 0 ] then flag_online=true break fi cnt=`expr $cnt - 1` # Decrement cnt sleep 1 done if [ $flag_online = true ] then $INFORMIXDIR/bin/onstat - /home/informix/bin/start_logging.sh & touch /var/lock/subsys/informix # Note: This line important for Linux echo "done" else echo "Warning: the Informix Online Engine did NOT start successfully!" fi fi ;; 'stop') if [ `$INFORMIXDIR/bin/onstat 2>&- | grep -c "not initialized"` -eq 0 ] then /home/informix/bin/stop_logging.sh echo -n "Shutting down the Informix Online Engine... " $INFORMIXDIR/bin/onmode -ky cnt=60 # Give informix 60 seconds to come offline before giving up flag_online=true while [ $cnt -gt 0 ] do if [ `$INFORMIXDIR/bin/onstat 2>&- | grep -c "not initialized"` -ne 0 ] then flag_online=false break fi cnt=`expr $cnt - 1` # Decrement cnt sleep 1 done if [ $flag_online = true ] then echo "Warning: the Informix Online Engine did NOT go offline successfully!" else echo "done" fi rm -f /var/lock/subsys/informix # Note: This line important for Linux fi ;; *) echo "Usage: $0 {start|stop}" ;; esac fi