4848SCRIPTPATH=" $( cd " $( dirname " $0 " ) " > /dev/null 2>&1 ; pwd -P ) "
4949
5050source ${SCRIPTPATH} /utils.sh
51- [ $? -ne 0 ] && echo " Error: missing file ${SCRIPTPATH} /utils.sh" && exit 1
51+ [ $? -ne 0 ] && echo " [SEVERE] Missing file ${SCRIPTPATH} /utils.sh" && exit 1
5252
5353export WL_HOME=" ${WL_HOME:-/ u01/ oracle/ wlserver} "
5454
6767 checkEnv SERVER_NAME ADMIN_NAME AS_SERVICE_NAME SERVICE_NAME USER_MEM_ARGS || exit 1
6868fi
6969
70- [ ! -d " ${JAVA_HOME} " ] && trace " Error: JAVA_HOME directory not found '${JAVA_HOME} '." && exit 1
71- [ ! -d " ${DOMAIN_HOME} " ] && trace " Error: DOMAIN_HOME directory not found '${DOMAIN_HOME} '." && exit 1
72- [ ! -f " ${DOMAIN_HOME} /config/config.xml" ] && trace " Error: '${DOMAIN_HOME} /config/config.xml' not found." && exit 1
73- [ ! -d " ${WL_HOME} " ] && trace " Error: WL_HOME '${WL_HOME} ' not found." && exit 1
74- [ ! -f " ${stm_script} " ] && trace " Error: Missing script '${stm_script} ' in WL_HOME '${WL_HOME} '." && exit 1
70+ [ ! -d " ${JAVA_HOME} " ] && trace SEVERE " JAVA_HOME directory not found '${JAVA_HOME} '." && exit 1
71+ [ ! -d " ${DOMAIN_HOME} " ] && trace SEVERE " DOMAIN_HOME directory not found '${DOMAIN_HOME} '." && exit 1
72+ [ ! -f " ${DOMAIN_HOME} /config/config.xml" ] && trace SEVERE " '${DOMAIN_HOME} /config/config.xml' not found." && exit 1
73+ [ ! -d " ${WL_HOME} " ] && trace SEVERE " WL_HOME '${WL_HOME} ' not found." && exit 1
74+ [ ! -f " ${stm_script} " ] && trace SEVERE " Missing script '${stm_script} ' in WL_HOME '${WL_HOME} '." && exit 1
7575
7676#
7777# Helper fn to create a folder
8080function createFolder {
8181 mkdir -m 750 -p " $1 "
8282 if [ ! -d " $1 " ]; then
83- trace " Unable to create folder '$1 '."
83+ trace SEVERE " Unable to create folder '$1 '."
8484 exit 1
8585 fi
8686}
@@ -118,12 +118,12 @@ createFolder ${NODEMGR_HOME}
118118NODEMGR_LOG_HOME=${NODEMGR_LOG_HOME:- ${LOG_HOME:- ${NODEMGR_HOME} / ${DOMAIN_UID} } }
119119FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR=${FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR:- true}
120120
121- trace " Info: NODEMGR_HOME='${NODEMGR_HOME} '"
122- trace " Info: LOG_HOME='${LOG_HOME} '"
123- trace " Info: SERVER_NAME='${SERVER_NAME} '"
124- trace " Info: DOMAIN_UID='${DOMAIN_UID} '"
125- trace " Info: NODEMGR_LOG_HOME='${NODEMGR_LOG_HOME} '"
126- trace " Info: FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR='${FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR} '"
121+ trace " NODEMGR_HOME='${NODEMGR_HOME} '"
122+ trace " LOG_HOME='${LOG_HOME} '"
123+ trace " SERVER_NAME='${SERVER_NAME} '"
124+ trace " DOMAIN_UID='${DOMAIN_UID} '"
125+ trace " NODEMGR_LOG_HOME='${NODEMGR_LOG_HOME} '"
126+ trace " FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR='${FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR} '"
127127
128128createFolder ${NODEMGR_LOG_HOME}
129129
@@ -153,7 +153,7 @@ rm -f ${nodemgr_lck_file}
153153# is the domain name:
154154domain_name=` cat ${DOMAIN_HOME} /config/config.xml | sed ' s/[[:space:]]//g' | grep ' ^<name>' | head -1 | awk -F' <|>' ' {print $3}' `
155155if [ " $domain_name " = " " ]; then
156- trace " Could not determine domain name"
156+ trace SEVERE " Could not determine domain name"
157157 exit 1
158158fi
159159
@@ -170,7 +170,7 @@ cat <<EOF > ${nm_domains_file}
170170 ${domain_name} =${DOMAIN_HOME}
171171EOF
172172
173- [ ! $? -eq 0 ] && trace " Failed to create '${nm_domains_file} '." && exit 1
173+ [ ! $? -eq 0 ] && trace SEVERE " Failed to create '${nm_domains_file} '." && exit 1
174174
175175cat << EOF > ${nm_props_file}
176176 #Node manager properties
@@ -202,7 +202,7 @@ cat <<EOF > ${nm_props_file}
202202
203203EOF
204204
205- [ ! $? -eq 0 ] && trace " Failed to create '${nm_props_file} '." && exit 1
205+ [ ! $? -eq 0 ] && trace SEVERE " Failed to create '${nm_props_file} '." && exit 1
206206
207207# ##############################################################################
208208#
@@ -225,7 +225,8 @@ if [ ! "${SERVER_NAME}" = "introspector" ]; then
225225
226226 if [ -f " $wl_state_file " ]; then
227227 trace " Removing stale file '$wl_state_file '."
228- rm -f ${wl_state_file} || exit 1
228+ rm -f ${wl_state_file}
229+ [ ! $? -eq 0 ] && trace SEVERE " Could not remove stale file '$wl_state_file '." && exit 1
229230 fi
230231
231232
@@ -248,7 +249,7 @@ Arguments=${USER_MEM_ARGS} -XX\\:+UnlockExperimentalVMOptions -XX\\:+UseCGroupMe
248249
249250EOF
250251
251- [ ! $? -eq 0 ] && trace " Failed to create '${wl_props_file} '." && exit 1
252+ [ ! $? -eq 0 ] && trace SEVERE " Failed to create '${wl_props_file} '." && exit 1
252253
253254 if [ ! " ${ADMIN_NAME} " = " ${SERVER_NAME} " ]; then
254255 admin_protocol=" http"
@@ -295,8 +296,10 @@ export JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.RootDirectory=${DOMAIN_HOME}"
295296
296297trace " Start the nodemanager, node manager home is '${NODEMGR_HOME} ', log file is '${nodemgr_log_file} ', out file is '${nodemgr_out_file} '."
297298
298- rm -f ${nodemgr_log_file} || exit 1
299- rm -f ${nodemgr_out_file} || exit 1
299+ rm -f ${nodemgr_log_file}
300+ [ ! $? -eq 0 ] && trace SEVERE " Could not remove old file '$nodemgr_log_file '." && exit 1
301+ rm -f ${nodemgr_out_file}
302+ [ ! $? -eq 0 ] && trace SEVERE " Could not remove old file '$nodemgr_out_file '." && exit 1
300303
301304${stm_script} > ${nodemgr_out_file} 2>&1 &
302305
@@ -309,11 +312,11 @@ while [ 1 -eq 1 ]; do
309312 break
310313 fi
311314 if [ $(( SECONDS - $start_secs )) -ge $max_wait_secs ]; then
312- trace " Info: Contents of node manager log '$nodemgr_log_file ':"
315+ trace INFO " Contents of node manager log '$nodemgr_log_file ':"
313316 cat ${nodemgr_log_file}
314- trace " Info: Contents of node manager out '$nodemgr_out_file ':"
317+ trace INFO " Contents of node manager out '$nodemgr_out_file ':"
315318 cat ${NODEMGR_OUT_FILE}
316- trace " Error: node manager failed to start within $max_wait_secs seconds."
319+ trace SEVERE " Node manager failed to start within $max_wait_secs seconds."
317320 exit 1
318321 fi
319322 wait_count=$(( wait_count + 1 ))
0 commit comments