Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RA SAPDatabase/SAPInstance: report proper exit codes in case required…
… software is not installed

--HG--
extra : convert_revision : c6fb08b029381f83728505d17b0aeecc0233069d
  • Loading branch information
dmuhamedagic committed Nov 29, 2007
1 parent 884cb5a commit 5100a06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions heartbeat/SAPDatabase
Expand Up @@ -637,8 +637,12 @@ do
fi
fi
done
LSB_STATUS_STOPPED=3
if [ -z "$DIR_EXECUTABLE" ]
then
[ "$1" = stop ] && exit $OCF_SUCCESS
[ "$1" = monitor ] && exit $OCF_NOT_RUNNING
[ "$1" = status ] && exit $LSB_STATUS_STOPPED
ocf_log err "Cannot find $EXESTARTDB,$EXESTOPDB and $EXEDBCONNECT executable, please set DIR_EXECUTABLE parameter!"
exit $OCF_ERR_GENERIC
fi
Expand Down
4 changes: 4 additions & 0 deletions heartbeat/SAPInstance
Expand Up @@ -325,6 +325,7 @@ InstanceNr=`echo "$InstanceName" | sed 's/.*\([0-9][0-9]\)$/\1/'`
SAPVIRHOST=`echo "$OCF_RESKEY_InstanceName" | cut -d_ -f3`

# optional OCF parameters, we try to guess which directories are correct
LSB_STATUS_STOPPED=3
if [ -z "$OCF_RESKEY_DIR_EXECUTABLE" ]
then
if [ -x /usr/sap/$SID/$InstanceName/exe/sapstartsrv -a -x /usr/sap/$SID/$InstanceName/exe/sapcontrol ]
Expand All @@ -338,6 +339,9 @@ then
SAPSTARTSRV="/usr/sap/$SID/SYS/exe/run/sapstartsrv"
SAPCONTROL="/usr/sap/$SID/SYS/exe/run/sapcontrol"
else
[ "$1" = stop ] && exit $OCF_SUCCESS
[ "$1" = monitor ] && exit $OCF_NOT_RUNNING
[ "$1" = status ] && exit $LSB_STATUS_STOPPED
ocf_log err "Cannot find sapstartsrv and sapcontrol executable, please set DIR_EXECUTABLE parameter!"
exit $OCF_ERR_GENERIC
fi
Expand Down

0 comments on commit 5100a06

Please sign in to comment.