Print this page
Split Close
Expand all
Collapse all
          --- /workspace/neilga/ohacds-ids/webrev/usr/src/cmd/ha-services/gds-agents/ids/functions.ksh-
          +++ functions.ksh
↓ open down ↓ 390 lines elided ↑ open up ↑
 391  391             scds_syslog -p daemon.info -t $(syslog_tag) -m \
 392  392                  "start_ids - Informix Server (%s) started rc(%s)" \
 393  393                  "${INFORMIXSERVER}" "${rc}"
 394  394  
 395  395             # At present there is no equivalent "wait_for_online" within SMF
 396  396             # therefore we'll perform our own.
 397  397  
 398  398             if [ "${CALLER}" = "SMF" ]
 399  399             then
 400  400                  smf_wait_for_online
 401      -                rc=?
      401 +                rc=$?
 402  402             fi
 403  403          else
 404  404             # SCMSGS
 405  405             # @explanation
 406  406             # The specified Informix Server failed to start.
 407  407             # @user_action
 408  408             # Check the syslog for further messages. If possible the 
 409  409             # Solaris Cluster will attempt to restart the Informix
 410  410             # Server.
 411  411             scds_syslog -p daemon.error -t $(syslog_tag) -m \
↓ open down ↓ 240 lines elided ↑ open up ↑
 652  652  
 653  653          debug_message "Function: stop_ids - End"
 654  654          return 0
 655  655  }
 656  656  
 657  657  smf_wait_for_online()
 658  658  {
 659  659          debug_message "Function: smf_wait_for_online - Begin"
 660  660          ${SET_DEBUG}
 661  661  
      662 +        # In order to ensure that the SMF service is really online, we need
      663 +        # to check getstate() and check_ids(). However, we need to enforce
      664 +        # an SMF_EXIT_ERR_CONFIG if we are just about to timeout. If we do not
      665 +        # do this, then svc.startd will try to restart the SMF service three
      666 +        # times. Essentially we need Sun Cluster to do that.
      667 +
 662  668          MAX_START_TIMEOUT=`/usr/bin/expr ${START_TIMEOUT} \* 95 \/ 100`
 663  669          SECONDS=0
 664  670  
 665  671          while  [ "${SECONDS}" -lt "${MAX_START_TIMEOUT}" ]
 666  672          do
 667  673             get_state
 668  674             check_ids
 669  675             rc=$?
 670  676  
 671  677             # Check_ids will return 0 if
 672  678             # - The Informix Server is running
 673  679             # - No blocked on "MEDIA FAILURE" or "HANG_SYSTEM" exists
 674  680  
 675  681             if [ "${rc}" -eq 0 ]
 676  682             then
 677      -                SECONDS=${MAX_START_TIMEOUT}
      683 +                SECONDS=${MAX_START_TIMEOUT}
 678  684             else
 679      -                sleep 5
      685 +                rc=${SMF_EXIT_ERR_CONFIG}
      686 +                sleep 2
 680  687             fi
 681  688          done
 682  689  
 683  690          debug_message "Function: smf_wait_for_online - End"
 684  691          return ${rc}
 685  692  }
 686  693  
 687  694  cleanup_ipc()
 688  695  {
 689  696          debug_message "Function: cleanup_ipc - Begin"
↓ open down ↓ 26 lines elided ↑ open up ↑
 716  723                  else
 717  724                     if /usr/bin/ps -p ${CPID} -o zone | /usr/bin/grep " ${ZONENAME}$" > /dev/null
 718  725                     then
 719  726                          debug_message "Informix SHMID: ${SHMID} - CPID ${CPID} is running"
 720  727                     else
 721  728                          SHMID=`/usr/bin/echo ${SHMID} | /usr/xpg4/bin/tr 'm' ' '`
 722  729  
 723  730                          # As the initial ipcs -mcopbZ is only a snapshot in time, Informix
 724  731                          # may have already cleaned up. Therefore the following attempt to remove a 
 725  732                          # shared memory segment may fail with "not found". To prevent misleading 
 726      -                        # console messages stdout/stderr is redirected to ${LOGFILE}. 
      733 +                        # console messages stdout/stderr is redirected to /dev/null. 
 727  734  
 728      -                        /usr/bin/ipcrm -z ${ZONENAME} -m ${SHMID} > ${LOGFILE}
      735 +                        /usr/bin/ipcrm -z ${ZONENAME} -m ${SHMID} > /dev/null 2>&1
 729  736  
 730  737                          debug_message "Informix SHMID: ${SHMID} - removed"
 731  738  
 732  739                          flag=deleted
 733  740                     fi
 734  741                  fi
 735  742             done
 736  743  
 737  744          if [ -n "${flag}" ]
 738  745          then
↓ open down ↓ 21 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX