Skip to content

Commit 8a9a8ce

Browse files
committed
change the name of the stop server out file and the variable name per Tom's comments
1 parent 6337060 commit 8a9a8ce

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SCRIPTPATH="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
1313
source ${SCRIPTPATH}/traceUtils.sh
1414
[ $? -ne 0 ] && echo "Error: missing file ${SCRIPTPATH}/traceUtils.sh" && exit 1
1515

16-
trace "Stop server ${SERVER_NAME}" &>> ${SERVER_OUT_FILE}
16+
trace "Stop server ${SERVER_NAME}" &>> ${STOP_OUT_FILE}
1717

1818
checkEnv SERVER_NAME || exit 1
1919

@@ -28,31 +28,31 @@ function check_for_shutdown() {
2828
state=`${SCRIPTPATH}/readState.sh`
2929
exit_status=$?
3030
if [ $exit_status -ne 0 ]; then
31-
trace "Node manager not running or server instance not found; assuming shutdown" &>> ${SERVER_OUT_FILE}
31+
trace "Node manager not running or server instance not found; assuming shutdown" &>> ${STOP_OUT_FILE}
3232
return 0
3333
fi
3434

3535
if [ "$state" = "SHUTDOWN" ]; then
36-
trace "Server is shutdown" &>> ${SERVER_OUT_FILE}
36+
trace "Server is shutdown" &>> ${STOP_OUT_FILE}
3737
return 0
3838
fi
3939

4040
if [[ "$state" =~ ^FAILED ]]; then
41-
trace "Server in failed state" &>> ${SERVER_OUT_FILE}
41+
trace "Server in failed state" &>> ${STOP_OUT_FILE}
4242
return 0
4343
fi
4444

45-
trace "Server is currently in state $state" &>> ${SERVER_OUT_FILE}
45+
trace "Server is currently in state $state" &>> ${STOP_OUT_FILE}
4646
return 1
4747
}
4848

4949
# setup ".out" location for a WL server
5050
serverLogHome="${LOG_HOME:-${DOMAIN_HOME}/servers/${SERVER_NAME}/logs}"
51-
SERVER_OUT_FILE="${serverLogHome}/stop-${SERVER_NAME}.out"
51+
STOP_OUT_FILE="${serverLogHome}/${SERVER_NAME}.stop.out"
5252

5353
# Check if the server is already shutdown
5454
check_for_shutdown
55-
[ $? -eq 0 ] && trace "Server already shutdown or failed" &>> ${SERVER_OUT_FILE} && exit 0
55+
[ $? -eq 0 ] && trace "Server already shutdown or failed" &>> ${STOP_OUT_FILE} && exit 0
5656

5757
# Otherwise, connect to the node manager and stop the server instance
5858
[ ! -f "${SCRIPTPATH}/wlst.sh" ] && trace "Error: missing file '${SCRIPTPATH}/wlst.sh'." && exit 1
@@ -64,17 +64,17 @@ export SHUTDOWN_TIMEOUT_ARG=${SHUTDOWN_TIMEOUT:-30}
6464
export SHUTDOWN_IGNORE_SESSIONS_ARG=${SHUTDOWN_IGNORE_SESSIONS:-false}
6565
export SHUTDOWN_TYPE_ARG=${SHUTDOWN_TYPE:-Graceful}
6666

67-
trace "Before stop-server.py [${SERVER_NAME}] ${SCRIPTDIR}" &>> ${SERVER_OUT_FILE}
68-
${SCRIPTPATH}/wlst.sh /weblogic-operator/scripts/stop-server.py &>> ${SERVER_OUT_FILE}
69-
trace "After stop-server.py" &>> ${SERVER_OUT_FILE}
67+
trace "Before stop-server.py [${SERVER_NAME}] ${SCRIPTDIR}" &>> ${STOP_OUT_FILE}
68+
${SCRIPTPATH}/wlst.sh /weblogic-operator/scripts/stop-server.py &>> ${STOP_OUT_FILE}
69+
trace "After stop-server.py" &>> ${STOP_OUT_FILE}
7070

7171
# at this point node manager should have terminated the server
7272
# but let's try looking for the server process and
7373
# kill the server if the process still exists,
7474
# just in case we failed to stop it via wlst
7575
pid=$(jps -v | grep " -Dweblogic.Name=${SERVER_NAME} " | awk '{print $1}')
7676
if [ ! -z $pid ]; then
77-
echo "Killing the server process $pid" &>> ${SERVER_OUT_FILE}
77+
echo "Killing the server process $pid" &>> ${STOP_OUT_FILE}
7878
kill -15 $pid
7979
fi
8080

@@ -83,4 +83,4 @@ if [ -f /weblogic-operator/pid ]; then
8383
kill -2 $(</weblogic-operator/pid)
8484
fi
8585

86-
trace "Exit script" &>> ${SERVER_OUT_FILE}
86+
trace "Exit script" &>> ${STOP_OUT_FILE}

0 commit comments

Comments
 (0)