Skip to content

Commit f900c0d

Browse files
committed
Supporting nowait parameter in runOracle.sh file when provided by pre-db extension
1 parent 5d32306 commit f900c0d

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ fi;
179179

180180
# Check whether database is up and running
181181
$ORACLE_BASE/$CHECK_DB_FILE
182-
if [ $? -eq 0 ]; then
182+
status=$?
183+
184+
if [ $status -eq 0 ]; then
183185
echo "#########################"
184186
echo "DATABASE IS READY TO USE!"
185187
echo "#########################"
@@ -196,6 +198,13 @@ else
196198
echo "#####################################"
197199
fi;
198200

201+
# Exiting the script without waiting on the tail logs
202+
if [ "$1" = "--nowait" ]; then
203+
# Creating state-file for identifyig container of the prebuiltdb extended image
204+
touch "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb"
205+
exit $status;
206+
fi
207+
199208
# Tail on alert log and wait (otherwise container will exit)
200209
echo "The following output is now a tail of the alert.log:"
201210
tail -f $ORACLE_BASE/diag/rdbms/*/*/trace/alert*.log &

OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ fi;
179179

180180
# Check whether database is up and running
181181
$ORACLE_BASE/$CHECK_DB_FILE
182-
if [ $? -eq 0 ]; then
182+
status=$?
183+
184+
if [ $status -eq 0 ]; then
183185
echo "#########################"
184186
echo "DATABASE IS READY TO USE!"
185187
echo "#########################"
@@ -196,6 +198,13 @@ else
196198
echo "#####################################"
197199
fi;
198200

201+
# Exiting the script without waiting on the tail logs
202+
if [ "$1" = "--nowait" ]; then
203+
# Creating state-file for identifyig container of the prebuiltdb extended image
204+
touch "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb"
205+
exit $status;
206+
fi
207+
199208
# Tail on alert log and wait (otherwise container will exit)
200209
echo "The following output is now a tail of the alert.log:"
201210
tail -f $ORACLE_BASE/diag/rdbms/*/*/trace/alert*.log &

0 commit comments

Comments
 (0)