Skip to content
Snippets Groups Projects
Commit ffa6c9e4 authored by kaloyane's avatar kaloyane
Browse files

[LMS-2609] do not abort waiting in "bisup.sh" if the AS process is active and...

[LMS-2609] do not abort waiting in "bisup.sh" if the AS process is active and writes to the log files

SVN: 23473
parent 6d95197a
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
# Starts up openBIS server # Starts up openBIS server
function fileAgeInSeconds() {
FILE_NAME=$(basename $1)
DIR_NAME=$(dirname $1)
fftime=$(find $DIR_NAME -name $FILE_NAME -type f -printf '%T@')
nnow=$(date +%s)
return $(expr $nnow - ${fftime%%\.*})
}
STARTING_MESSAGE="STARTING SERVER" STARTING_MESSAGE="STARTING SERVER"
STARTED_MESSAGE="SERVER STARTED" STARTED_MESSAGE="SERVER STARTED"
ERROR_MESSAGE="ERROR" ERROR_MESSAGE="ERROR"
...@@ -24,13 +35,21 @@ fi ...@@ -24,13 +35,21 @@ fi
JETTY_HOME=$BASE/../servers/openBIS-server/jetty JETTY_HOME=$BASE/../servers/openBIS-server/jetty
OPENBIS_LOG=$JETTY_HOME/logs/openbis_log.txt OPENBIS_LOG=$JETTY_HOME/logs/openbis_log.txt
JETTY_LOG=$JETTY_HOME/logs/jetty.out JETTY_LOG=$JETTY_HOME/logs/jetty.out
TIMEOUT=15
echo Starting openBIS... echo Starting openBIS...
echo $STARTING_MESSAGE >> $OPENBIS_LOG echo $STARTING_MESSAGE >> $OPENBIS_LOG
$JETTY_HOME/bin/startup.sh $JETTY_HOME/bin/startup.sh
for i in {1..120}; do bisLogAgeInSeconds=5
jettyLogAgeInSeconds=5
#
# Loop while the openBIS process alters writes to the log files
#
while [ "$bisLogAgeInSeconds" -lt $TIMEOUT ] || [ "$jettyLogAgeInSeconds" -lt $TIMEOUT ]; do
echo -n "." echo -n "."
sleep 2 sleep 2
...@@ -55,6 +74,11 @@ for i in {1..120}; do ...@@ -55,6 +74,11 @@ for i in {1..120}; do
exit 1; exit 1;
fi fi
fileAgeInSeconds $OPENBIS_LOG
bisLogAgeInSeconds=$?
fileAgeInSeconds $JETTY_LOG
jettyLogAgeInSeconds=$?
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment