Skip to content

Commit bb40ad8

Browse files
committed
Harden liveness probe by checking for server process or any failed state in state file
1 parent ad15db0 commit bb40ad8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

operator/src/main/resources/scripts/livenessProbe.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ if [ "${MOCK_WLS}" != 'true' ]; then
7373
# Adjust PATH if necessary before calling jps
7474
adjustPath
7575

76-
if [ `jps -l | grep -c " weblogic.NodeManager"` -eq 0 ]; then
77-
trace SEVERE "WebLogic NodeManager process not found."
76+
if [ `jps -v | grep -c " -Dweblogic.Name=${SERVER_NAME} "` -eq 0 ]; then
77+
trace SEVERE "WebLogic Server instance process not found."
7878
exit $RETVAL
7979
fi
8080
fi
8181

82-
if [ -f ${STATEFILE} ] && [ `grep -c "FAILED_NOT_RESTARTABLE" ${STATEFILE}` -eq 1 ]; then
82+
if [ -f ${STATEFILE} ] && [ `grep -c "FAILED" ${STATEFILE}` -eq 1 ]; then
8383
# WARNING: This state file check is essentially a public API and
8484
# must continue to be honored even if we remove the node
8585
# manager from the life cycle.
@@ -88,7 +88,7 @@ if [ -f ${STATEFILE} ] && [ `grep -c "FAILED_NOT_RESTARTABLE" ${STATEFILE}` -eq
8888
# the file to FAILED_NOT_RESTARTABLE to force a liveness
8989
# failure when the user detects that their applications
9090
# are unresponsive.)
91-
trace SEVERE "WebLogic Server state is FAILED_NOT_RESTARTABLE."
91+
trace SEVERE "WebLogic Server state is " `cat ${STATEFILE} | cut -f 1 -d ':'` "."
9292
exit $RETVAL
9393
fi
9494

0 commit comments

Comments
 (0)