1 Reply Latest reply: Jun 7, 2011 4:55 PM by hqt200475 RSS

    Can't start or stop resource

    hqt200475
      Hi,

      My Environement:

      + RAC with 2 Nodes named dwh and stb ( Linux Red Hat 5.4 / 64-Bit + Oracle Enterprise 11.2.0.2) .

      I defined an Actionscript like this:
      /home/oracle/ACTION>cat myxclock.scr
      #!/bin/bash
      # start/stop/check script for xclock example
      # To test this change BIN_DIR to the directory where xclock is based
      # and set the DISPLAY variable to a server within your network.
      
      #BIN_DIR=/usr/X11R6/bin
      BIN_DIR=/usr/bin
      LOG_DIR=/tmp
      BIN_NAME=xclock
      DISPLAY=`hostname`:6.0
      #DISPLAY=`hostname`:3.0
      export DISPLAY
      exit_code=0
      
      if [ ! -d $BIN_DIR ]
      then
              echo "start failed"
              exit 2
      fi
      
      PID1=`ps -ef | grep $BIN_NAME | grep -v grep | grep -v myxclock.scr | awk '{ print $2 }'`
      case $1 in
      'start')
              if [ "$PID1" != "" ]
              then
                 status_p1="running"
              else
                 if [ -x $BIN_DIR/$BIN_NAME ]
                 then
                   umask 002
                   ${BIN_DIR}/${BIN_NAME} & 2>${LOG_DIR}/${BIN_NAME}.log
                   status_p1="started"
                 else
                   echo `basename $0`": $BIN_NAME: Executable not found"
                   exit_code=1
                 fi
              fi
      
               echo "$BIN_NAME: $status_p1"
               exit $exit_code
              ;;
      
      'stop')
              if [ "${PID1}" != "" ]
              then
                 kill -9 ${PID1} && echo "$BIN_NAME daemon killed"
              else
                 echo "$BIN_NAME: no running Process!"
              fi
              exit $exit_code
              ;;
      'check')
              if [ "$PID1" != "" ]
              then
                 echo "running"
                 exit 0
              else
                 echo "not running"
                 exit 1
              fi
              ;;*)
              echo "Usage: "`basename $0`" {start|stop|check}"
              ;;
      esac
      and registered it in CW:
      crsctl add resource myxclock -type cluster_resource \
       -attr "ACTION_SCRIPT=/home/oracle/ACTION/myxclock.scr, \
       PLACEMENT=restricted,HOSTING_MEMBERS=stb dwh,CHECK_INTERVAL=30, \
       RESTART_ATTEMPTS=2,START_DEPENDENCIES=hard(ora.net1.network), \
       STOP_DEPENDENCIES=hard(ora.net1.network)"
      
      
      /home/oracle/ACTION>crsctl status resource myxclock -f
      NAME=myxclock
      TYPE=cluster_resource
      STATE=OFFLINE
      TARGET=ONLINE
      ACL=owner:root:rwx,pgrp:root:r-x,other::r--
      ACTION_FAILURE_TEMPLATE=
      ACTION_SCRIPT=/home/oracle/ACTION/myxclock.scr
      ACTIVE_PLACEMENT=0
      AGENT_FILENAME=%CRS_HOME%/bin/scriptagent
      AUTO_START=restore
      CARDINALITY=1
      CARDINALITY_ID=0
      CHECK_INTERVAL=30
      CREATION_SEED=454
      DEFAULT_TEMPLATE=
      DEGREE=1
      DESCRIPTION=
      ENABLED=1
      FAILOVER_DELAY=0
      FAILURE_INTERVAL=0
      FAILURE_THRESHOLD=0
      HOSTING_MEMBERS=stb dwh
      ID=myxclock
      LOAD=1
      LOGGING_LEVEL=1
      NOT_RESTARTING_TEMPLATE=
      OFFLINE_CHECK_INTERVAL=0
      PLACEMENT=restricted
      PROFILE_CHANGE_TEMPLATE=
      RESTART_ATTEMPTS=2
      SCRIPT_TIMEOUT=60
      SERVER_POOLS=
      START_DEPENDENCIES=hard(ora.net1.network)
      START_TIMEOUT=0
      STATE_CHANGE_TEMPLATE=
      STOP_DEPENDENCIES=hard(ora.net1.network)
      STOP_TIMEOUT=0
      UPTIME_THRESHOLD=1h
      I can start and stop successfully the actionscript with :
      /home/oracle/ACTION/myxclock.scr {start|stop|check}
      xclock appeared on the X-Terminal

      But starting resource is not possible! Command:
      crsctl  {start|stop } resource myxclock 
      showed no effect.

      What have I done wrong? Please, help!

      regards

      hqt200475