#!/bin/sh # # init.crs - Control script for the CRS product as a whole # # This should be linked into an appropriate rcX.d directory. # # Supported options: # init.crs start manual startup of the CRS stack # init.crs stop shuts down the CRS stack # init.crs disable prevents CRS stack from starting at boot time # init.crs enable allows CRS stack to start at boot time # ECHO=/bin/echo SLEEP=/bin/sleep BASENAME=/bin/basename LOGMSG="/bin/logger -puser.err" #Following variable is used only on SuSE PARENT_CMD="" case `/bin/uname` in Linux) ID=/etc/init.d LOGGER="/usr/bin/logger" if [ ! -f "$LOGGER" ];then LOGGER="/bin/logger" fi LOGMSG="$LOGGER -puser.err" if [ -f /etc/SuSE-release ]; then PARENT_CMD="`/bin/ps -p $PPID --no-headers -o comm`" fi ;; HP-UX) ID=/sbin/init.d;; SunOS) ID=/etc/init.d;; AIX) ID=/etc;; OSF1) ID=/sbin/init.d;; *) /bin/echo "ERROR: Unknown Operating System" exit -1 ;; esac case $1 in 'home') $ID/init.cssd home ;; 'stop') $ECHO "Shutting down Oracle Cluster Ready Services (CRS):" # Prevent respawn of the daemons while we are shutting down. $ID/init.cssd norun # Reverse order of startup. crsd should be shutdown before # cssd and evmd. evmd should be shutdown before cssd. $ID/init.crsd $* $ID/init.evmd $* $ID/init.cssd $* ;; 'enable') # This is the supported way of enabling the CRS stack's automatic startup. $ID/init.cssd enable ;; 'disable') # This is the supported way of disabling the CRS stack's automatic startup. $ID/init.cssd disable ;; 'start') CMD=`$BASENAME $0` # If we are being invoked by the user, perform manual startup. # If we are being invoked as an RC script, check for autostart. if [ "$CMD" = "init.crs" ] && [ "$PARENT_CMD" != "startpar" ]; then $LOGMSG "Oracle Cluster Ready Services starting by user request." $ID/init.cssd manualstart else $ID/init.cssd autostart fi ;; 'start_msg') # start message if we are being invoked as an RC script (only on HP-UX) $ECHO "Start Oracle Cluster Ready Services" ;; 'stop_msg') # stop message if we are being invoked as an RC script (only on HP-UX) $ECHO "Stop Oracle Cluster Ready Services" ;; *) $ECHO "Usage: $0 {stop|start|enable|disable}" exit 1; ;; esac