diff --git a/ra/SAPHana b/ra/SAPHana index 1f0a2e5b..e99482b7 100755 --- a/ra/SAPHana +++ b/ra/SAPHana @@ -111,7 +111,7 @@ function super_ocf_log() { # globals: $0(r) # function saphana_usage() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 methods=$(saphana_methods) methods=$(echo $methods | tr ' ' '|') @@ -136,11 +136,11 @@ EOF } function backup_global_and_nameserver() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 cp /hana/shared/${SID}/global/hdb/custom/config/global.ini /hana/shared/${SID}/global/hdb/custom/config/global.ini.$(date +"%s") cp /hana/shared/${SID}/global/hdb/custom/config/nameserver.ini /hana/shared/${SID}/global/hdb/custom/config/nameserver.ini.$(date +"%s") - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -150,7 +150,7 @@ function backup_global_and_nameserver() { # globals: - # function saphana_meta_data() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # cat <>$log_attr_file; rc=$? ;; esac - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -493,7 +493,7 @@ function get_hana_attribute() # function set_hana_attribute() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local attr_node=$1 local attr_value=$2 local attr_name=$3 @@ -523,7 +523,7 @@ function set_hana_attribute() super_ocf_log debug "DBG: LET attribute $attr_name for node ${attr_node} still be ${attr_value}" rc=0 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -533,7 +533,7 @@ function set_hana_attribute() # globals: OCF_*(r) # function assert() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local err_msg=$1 local default_rc=$OCF_NOT_RUNNING # DONE: Check, if we need to distinguish between probe and others @@ -557,7 +557,7 @@ function assert() { # function set_crm_master() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 local score=0 if [ -n "$1" ]; then @@ -586,7 +586,7 @@ function set_crm_master() # scoring_crm_master() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local roles="$1" local sync="$2" local skip=0 @@ -619,7 +619,7 @@ scoring_crm_master() # function get_crm_master() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 ${HA_SBIN_DIR}/crm_master -G -q -l reboot; rc=$? return $rc @@ -783,7 +783,7 @@ function set_SRHOOK() # saphana_init : Define global variables with default values, if optional parameters are not set # function saphana_init() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_SUCCESS local clN SYSTEMCTL="/usr/bin/systemctl" @@ -1005,7 +1005,7 @@ function saphana_init() { hdbState="hdbnsutil -sr_state" hdbMap="hdbnsutil -sr_state" fi - super_ocf_log info "FLOW $FUNCNAME rc=$OCF_SUCCESS" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$OCF_SUCCESS" return $OCF_SUCCESS } @@ -1016,7 +1016,7 @@ function saphana_init() { # TODO: PRIO5: Might be dropped, if we get a script for fetching the sync status function check_secstore_users() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local user="" local rc=1 while [ $# -gt 0 ]; do @@ -1024,7 +1024,7 @@ function check_secstore_users() $DIR_EXECUTABLE/hdbuserstore list | grep -q "KEY $user" && echo "$user" && rc=0 && break shift done - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1103,7 +1103,7 @@ handle_unix_domain_sockets() { # check_sapstartsrv : Before using sapcontrol we make sure that the sapstartsrv is running. # function check_sapstartsrv() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local restart=0 local runninginst="" local rc=$OCF_SUCCESS @@ -1197,12 +1197,12 @@ function check_sapstartsrv() { # globals: - # function cleanup_instance() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # TODO: PRIO5: Check, if we need HANA cleanup procedure (processes, ipc obj, pid files); Currently not needed super_ocf_log debug "DBG: cleanup_instance currently not implemented" rc=0 - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" } # @@ -1211,7 +1211,7 @@ function cleanup_instance() { # globals: HANA_STATE_PRIMARY(r), HANA_STATE_SECONDARY(r), HANA_STATE_DEFECT(r) # function check_for_primary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$HANA_STATE_DEFECT # TODO: PRIO 3: Check beginning from which SPS does SAP support HDBSettings.sh? # DONE: Limit the runtime of hdbnsutil and use getParameter.py as fallback @@ -1263,7 +1263,7 @@ function check_for_primary() { esac; sleep 2 done - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1280,7 +1280,7 @@ function check_for_primary() { # Active = 15 function analyze_hana_sync_statusSRS() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=-1 srRc=0 all_nodes_other_side="" n="" siteParam="" if [ -n "$remSR_name" ]; then siteParam="--site=$remSR_name" @@ -1292,7 +1292,7 @@ function analyze_hana_sync_statusSRS() # SAP_CALL FULL_SR_STATUS=$(HANA_CALL --timeout 5 --cmd "python systemReplicationStatus.py $siteParam" 2>/dev/null); srRc=$? super_ocf_log info "DEC $FUNCNAME systemReplicationStatus.py (to site '$remSR_name')-> $srRc" - super_ocf_log info "FLOW $FUNCNAME systemReplicationStatus.py (to site '$remSR_name')-> $srRc" + super_ocf_log info "FLOW ${FUNCNAME[0]} systemReplicationStatus.py (to site '$remSR_name')-> $srRc" # # TODO: PRIO2: Here we might also need to filter additional sites (if multi tier should be supported) # And is the check for return code capable for chains? @@ -1300,14 +1300,14 @@ function analyze_hana_sync_statusSRS() if [ $srRc -eq 15 ]; then # Fix for a HANA BUG, where a non-working SR resulted in RC 15: if grep -q "ACTIVE" <<< "$FULL_SR_STATUS"; then - super_ocf_log info "FLOW $FUNCNAME SOK" + super_ocf_log info "FLOW ${FUNCNAME[0]} SOK" set_hana_attribute "$remoteNode" "SOK" "${ATTR_NAME_HANA_SYNC_STATUS[@]}" super_ocf_log info "ACT site=$sr_name, setting SOK for secondary (1)" lpa_set_lpt 30 "$remoteNode" rc=0; else # ok we should be careful and set secondary to SFAIL - super_ocf_log info "FLOW $FUNCNAME SFAIL" + super_ocf_log info "FLOW ${FUNCNAME[0]} SFAIL" set_hana_attribute "$remoteNode" "SFAIL" "${ATTR_NAME_HANA_SYNC_STATUS[@]}" super_ocf_log info "ACT site=$sr_name, setting SFAIL for secondary (6) - srRc=$srRc lss=$lss No ACTIVES found in cmd output" # TODO: PRIO1 - P004: need to check LSS again to avoid dying primary to block (SFAIL) secondary @@ -1321,7 +1321,7 @@ function analyze_hana_sync_statusSRS() rc=2 else # ok we should be careful and set secondary to SFAIL - super_ocf_log info "FLOW $FUNCNAME SFAIL" + super_ocf_log info "FLOW ${FUNCNAME[0]} SFAIL" set_hana_attribute "$remoteNode" "SFAIL" "${ATTR_NAME_HANA_SYNC_STATUS[@]}" super_ocf_log info "ACT site=$sr_name, setting SFAIL for secondary (5) - srRc=$srRc lss=$lss" # TODO: PRIO1 - P004: need to check LSS again to avoid dying primary to block (SFAIL) secondary @@ -1329,16 +1329,16 @@ function analyze_hana_sync_statusSRS() rc=1 fi else - super_ocf_log info "FLOW $FUNCNAME SFAIL" + super_ocf_log info "FLOW ${FUNCNAME[0]} SFAIL" set_hana_attribute "$remoteNode" "SFAIL" "${ATTR_NAME_HANA_SYNC_STATUS[@]}" super_ocf_log info "ACT site=$sr_name, setting SFAIL for secondary (2) - srRc=$srRc" # TODO: PRIO1 - P004: need to check LSS again to avoid dying primary to block (SFAIL) secondary lpa_set_lpt 10 "$remoteNode" rc=1; fi - super_ocf_log info "FLOW $FUNCNAME PRIM+LPA" + super_ocf_log info "FLOW ${FUNCNAME[0]} PRIM+LPA" super_ocf_log info "DBG PRIM" - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1353,7 +1353,7 @@ function analyze_hana_sync_statusSRS() # function analyze_hana_sync_statusSQL() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local -a clusterNodes=() local cl="" local vHost="" @@ -1422,7 +1422,7 @@ function analyze_hana_sync_statusSQL() # function get_hana_landscape_status() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # # TODO: Get rid of the su by using a new interface: @@ -1451,7 +1451,7 @@ function get_hana_landscape_status() # function register_hana_secondary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=2; local remoteInstance=""; local newParameter=0 @@ -1490,7 +1490,7 @@ function register_hana_secondary() super_ocf_log info "ACT: SAPHANA DROP REGISTER because AUTOMATED_REGISTER is set to FALSE" rc=1 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc; } @@ -1511,7 +1511,7 @@ function saphana_status() { # globals: OCF_*, SAPCONTROL, InstanceNr, SID, InstanceName, # function saphana_start() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_NOT_RUNNING local output="" local loopcount=0 @@ -1547,7 +1547,7 @@ function saphana_start() { super_ocf_log err "ACT: SAPHANA Instance $SID-$InstanceName start failed: $output" rc=$OCF_ERR_GENERIC fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1558,7 +1558,7 @@ function saphana_start() { # saphana_stop: Stop the SAP instance # function saphana_stop() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local output="" local rc=0 check_sapstartsrv; rc=$? @@ -1583,7 +1583,7 @@ function saphana_stop() { super_ocf_log err "ACT: SAP Instance $SID-$InstanceName stop failed: $output" rc=$OCF_ERR_GENERIC fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1594,7 +1594,7 @@ function saphana_stop() { # saphana_validate: Check the semantic of the input parameters # function saphana_validate() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_SUCCESS # # SID is Alpha-AlphaNumeric-Alphanumeric? @@ -1612,7 +1612,7 @@ function saphana_validate() { super_ocf_log err "ACT: Parsing instance profile name: '$InstanceNr' is not a valid instance number!" rc=$OCF_ERR_ARGS fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1623,7 +1623,7 @@ function saphana_validate() { # function saphana_start_primary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local primary_status sync_attr score_master rc=$OCF_NOT_RUNNING local lss sqlrc; local rc=0 @@ -1784,7 +1784,7 @@ function saphana_start_primary() rc="$OCF_NOT_RUNNING" ;; esac - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1795,7 +1795,7 @@ function saphana_start_primary() # check_for_primary_master() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=1 local ch ch_role # @@ -1818,7 +1818,7 @@ check_for_primary_master() fi done fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1833,7 +1833,7 @@ wait_for_primary_master() local rc=1 local loops=${1:-0} local count=0 - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" # # hana_ndb_roles=primary:master1:master:worker:master # @@ -1852,7 +1852,7 @@ wait_for_primary_master() sleep 10 fi done - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1863,7 +1863,7 @@ wait_for_primary_master() # function saphana_start_secondary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local primary_status sync_attr score_master rc=$OCF_NOT_RUNNING local sqlrc; set_crm_master 0 @@ -1905,7 +1905,7 @@ function saphana_start_secondary() set_crm_master -INFINITY rc=$OCF_SUCCESS fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1923,7 +1923,7 @@ function saphana_check_local_instance() local SERVNO local output local MONITOR_SERVICES="hdbnameserver|hdbdaemon" # TODO: PRIO1: exact list of Services - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" check_sapstartsrv rc=$? if [ $rc -eq $OCF_SUCCESS ] @@ -1965,7 +1965,7 @@ function saphana_check_local_instance() fi fi fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1977,7 +1977,7 @@ function saphana_check_local_instance() # globals: LPA_ATTR_*, # function lpa_get_lpt() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=1 local node=$1 local lpt="" @@ -1988,7 +1988,7 @@ function lpa_get_lpt() { else rc=2 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1999,7 +1999,7 @@ function lpa_get_lpt() { # rc: rc=0: OK, rc=1: InternalERROR, rc=2: ERROR # function lpa_set_lpt() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=1 local crm_rc=1 local lpt=$1 @@ -2016,7 +2016,7 @@ function lpa_set_lpt() { else super_ocf_log info "DEC: lpa_set_lpt - ignore to change value for empty node name" fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2028,7 +2028,7 @@ function lpa_set_lpt() { # rc: rc=0: OK, rc=1: InternalERROR, rc=2: ERROR # function lpa_pull_lpt() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=1 local lpt="" local readrest=0 @@ -2042,7 +2042,7 @@ function lpa_pull_lpt() { else rc=2 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2054,7 +2054,7 @@ function lpa_pull_lpt() { # rc: rc=0: OK, rc=1: InternalERROR, rc=2: ERROR # function lpa_push_lpt() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local lpt=$1 local clpt=-1 local rc=1 @@ -2068,7 +2068,7 @@ function lpa_push_lpt() { else rc=0 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2086,7 +2086,7 @@ function lpa_push_lpt() { # PRIMARY sets to 1 # function lpa_init_lpt() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=1 local LPTloc=-1 local LPTrem=-1 @@ -2106,7 +2106,7 @@ function lpa_init_lpt() { rc=2 fi lpa_set_lpt $LPTloc "$NODENAME" - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2145,7 +2145,7 @@ function lpa_init_lpt() { # WAIT ==> like STALEMATE-HANDLING ===> rc=2 (wait) # function lpa_check_lpt_status() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=4 local LPTloc=-1 local LPTrem=-1 @@ -2201,7 +2201,7 @@ function lpa_check_lpt_status() { rc=2 fi fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2212,10 +2212,10 @@ function lpa_check_lpt_status() { # globals: function is_the_master_nameserver() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # always true for scale-up - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2226,7 +2226,7 @@ function is_the_master_nameserver() # saphana_start_clone # function saphana_start_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local primary_status sync_attr score_master rc=$OCF_NOT_RUNNING local sqlrc; set_hana_attribute "${NODENAME}" "DEMOTED" "${ATTR_NAME_HANA_CLONE_STATE[@]}" @@ -2240,7 +2240,7 @@ function saphana_start_clone() { super_ocf_log error "SAP HANA is neither PRIMARY nor SECONDARY cant start this SAP HANA database for SR control." rc="$OCF_NOT_RUNNING" fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2251,7 +2251,7 @@ function saphana_start_clone() { # saphana_stop_clone # function saphana_stop_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 local primary_status="x" set_hana_attribute "${NODENAME}" "UNDEFINED" "${ATTR_NAME_HANA_CLONE_STATE[@]}" @@ -2312,7 +2312,7 @@ function recover_site_attributes_from_file() # function saphana_monitor_primary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_ERR_GENERIC local promoted=0 local init_attribute=0 @@ -2358,7 +2358,7 @@ function saphana_monitor_primary() # lpa - no need to wait any longer - lets try a new start saphana_start_clone rc=$? - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc ;; 2 ) @@ -2550,7 +2550,7 @@ function saphana_monitor_primary() fi ;; esac - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2562,7 +2562,7 @@ function saphana_monitor_primary() # function saphana_monitor_secondary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_ERR_GENERIC local promoted=0 local init_attribute=0 @@ -2674,7 +2674,7 @@ function saphana_monitor_secondary() rc=$OCF_NOT_RUNNING ;; esac - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2685,7 +2685,7 @@ function saphana_monitor_secondary() # saphana_monitor_clone # function saphana_monitor_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" # # TODO: PRIO3: For the secondary, which is missing the primary (so in status WAITING) what is better: # a) returning 7 here and force cluster a restart of the secondary @@ -2743,7 +2743,7 @@ function saphana_monitor_clone() { rc=$OCF_ERR_GENERIC fi fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2755,7 +2755,7 @@ function saphana_monitor_clone() { # In a multi-state configuration get Master being the primary OR by running hana takeover # function saphana_promote_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc="$OCF_SUCCESS"; local hana_sync; local primary_status; @@ -2827,7 +2827,7 @@ function saphana_promote_clone() { set_SRHOOK "$sr_name" "PRIM" fi fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2841,12 +2841,12 @@ function saphana_promote_clone() { # correct monitor return codes # function saphana_demote_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_ERR_GENERIC; set_hana_attribute "${NODENAME}" "DEMOTED" "${ATTR_NAME_HANA_CLONE_STATE[@]}" rc=$OCF_SUCCESS; super_ocf_log info "ACT: Demoted $SID-$InstanceName." - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } diff --git a/ra/SAPHanaTopology b/ra/SAPHanaTopology index e97d2df3..9b31088e 100755 --- a/ra/SAPHanaTopology +++ b/ra/SAPHanaTopology @@ -93,7 +93,7 @@ function super_ocf_log() { # globals: $0(r) # function sht_usage() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 methods=$(sht_methods) methods=$(echo $methods | tr ' ' '|') @@ -121,7 +121,7 @@ function sht_usage() { # globals: - # function sht_meta_data() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 cat < @@ -209,7 +209,7 @@ return $rc # function get_hana_attribute() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 local attr_node=$1 local attr_name=$2 @@ -227,7 +227,7 @@ function get_hana_attribute() crm_attribute -G -n "$attr_name" -t crm_config -q -d "$attr_default" 2>>$log_attr_file; rc=$? ;; esac - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -238,7 +238,7 @@ function get_hana_attribute() # function set_hana_attribute() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local attr_node=$1 local attr_value=$2 local attr_name=$3 @@ -265,7 +265,7 @@ function set_hana_attribute() super_ocf_log debug "DBG: LET attribute $attr_name for node ${attr_node} still be ${attr_value}" rc=0 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -276,7 +276,7 @@ function set_hana_attribute() # methods: What methods/operations do we support? # function sht_methods() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 cat <<-! start @@ -351,7 +351,7 @@ function version() { # Special EXIT of RA, if clone is missconfigured # function is_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # # is a clone config? @@ -369,7 +369,7 @@ function is_clone() { else rc=1; fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -471,7 +471,7 @@ function HANA_CALL() # function sht_init() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local myInstanceName="" local rc=$OCF_SUCCESS local hdbANSWER="" @@ -667,7 +667,7 @@ function sht_init() { done super_ocf_log info "DEC: site=$site, mode=$srmode, hanaRemoteHost=$hanaRemoteHost - found by remote site ($hanaSite)" fi - super_ocf_log info "FLOW $FUNCNAME rc=$OCF_SUCCESS" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$OCF_SUCCESS" return $OCF_SUCCESS } @@ -677,25 +677,25 @@ function sht_init() { # globals: srmode(r), HANA_STATE_PRIMARY(r), HANA_STATE_SECONDARY(r), HANA_STATE_DEFECT(r), HANA_STATE_STANDALONE(r) # function check_for_primary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 super_ocf_log debug "DBG: check_for_primary: srmode=$srmode" case "$srmode" in primary ) - super_ocf_log info "FLOW $FUNCNAME rc=HANA_STATE_PRIMARY" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=HANA_STATE_PRIMARY" rc=$HANA_STATE_PRIMARY;; syncmem | sync | async ) - super_ocf_log info "FLOW $FUNCNAME rc=HANA_STATE_SECONDARY" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=HANA_STATE_SECONDARY" rc=$HANA_STATE_SECONDARY;; none ) # have seen that mode on second side BEFEORE we registered it as replica - super_ocf_log info "FLOW $FUNCNAME rc=HANA_STATE_STANDALONE" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=HANA_STATE_STANDALONE" rc=$HANA_STATE_STANDALONE;; * ) dump=$( echo $srmode | hexdump -C ); super_ocf_log err "ACT: check_for_primary: we didn't expect srmode to be: DUMP: <$dump>" rc=$HANA_STATE_DEFECT esac; - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -802,7 +802,7 @@ function check_saphostagent() # sht_start : Start the SAP HANA instance # function sht_start() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_NOT_RUNNING local output="" @@ -821,7 +821,7 @@ function sht_start() { rc=$OCF_SUCCESS - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -832,7 +832,7 @@ function sht_start() { # sht_stop: Stop the SAP HANA Topology Resource # function sht_stop() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local output="" local rc=0 if [ -f $HA_RSCTMP/SAPHana/SAPTopologyON ]; then @@ -841,7 +841,7 @@ function sht_stop() { rm $HA_RSCTMP/SAPHana/SAPTopologyON.${SID} rc=$OCF_SUCCESS - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -853,7 +853,7 @@ function sht_stop() { # sht_monitor: Can the given SAP instance do anything useful? # function sht_monitor() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # check for old status file if [ -f $HA_RSCTMP/SAPHana/SAPTopologyON ]; then @@ -865,7 +865,7 @@ function sht_monitor() { else rc=$OCF_NOT_RUNNING fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -877,7 +877,7 @@ function sht_monitor() { # sht_status: Lightweight check of SAP instance only with OS tools # function sht_status() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 sht_monitor; rc=$? @@ -892,7 +892,7 @@ function sht_status() { # sht_validate: Check the symantic of the input parameters # function sht_validate() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_SUCCESS if [ $(echo "$SID" | grep -c '^[A-Z][A-Z0-9][A-Z0-9]$') -ne 1 ] then @@ -906,7 +906,7 @@ function sht_validate() { rc=$OCF_ERR_ARGS fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -917,7 +917,7 @@ function sht_validate() { # sht_start_clone # function sht_start_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_NOT_RUNNING sht_start; rc=$? return $rc @@ -930,7 +930,7 @@ function sht_start_clone() { # sht_stop_clone # function sht_stop_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 check_for_primary; primary_status=$? if [ $primary_status -eq $HANA_STATE_PRIMARY ]; then @@ -954,7 +954,7 @@ function sht_stop_clone() { # sht_monitor_clone # function sht_monitor_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" # local rc=$OCF_ERR_GENERIC local promoted=0 @@ -1095,7 +1095,7 @@ function sht_monitor_clone() { esac # fi # end ocf_is_NOT_probe - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1106,7 +1106,7 @@ function sht_monitor_clone() { # sht_notify: Handle master scoring - to make sure a slave gets the next master # function sht_notify() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 super_ocf_log info "RA ==== end action $ACTION$CLACT (${n_type}/${n_op})====" return $rc