Charles Chan
Committed by Gerrit Code Review

Be patient when waiting for karaf log

Change-Id: I5f4eca7cd8c4d62e94a510991b03e0193ea503e9
...@@ -30,5 +30,15 @@ unset ONOS_USE_SSH ...@@ -30,5 +30,15 @@ unset ONOS_USE_SSH
30 echo "$!" > /tmp/onos.pid 30 echo "$!" > /tmp/onos.pid
31 31
32 # Hang-on a bit and then start tailing the ONOS log output 32 # Hang-on a bit and then start tailing the ONOS log output
33 -sleep 1 33 +RETRY_COUNT=5
34 -tail -f ./apache*/data/log/karaf.log 34 +echo "Waiting for karaf.log"
35 +until [ $RETRY_COUNT -le 0 ]; do
36 + KARAF_LOG=$(find $ONOS_HOME -type f -name karaf.log)
37 + if [ $KARAF_LOG ]; then
38 + tail -f $KARAF_LOG
39 + return
40 + fi
41 + RETRY_COUNT=$[$RETRY_COUNT-1]
42 + sleep 1
43 +done
44 +echo "Fail to open karaf.log"
...\ No newline at end of file ...\ No newline at end of file
......