Wait until tomcat finishes starting up

前端 未结 8 2137
囚心锁ツ
囚心锁ツ 2020-12-24 13:29

I have a script that needs to run after tomcat has finished starting up and is ready to start deploying applications. I\'m using $TOMCAT_HOME/bin/startup.sh whi

相关标签:
8条回答
  • 2020-12-24 14:05

    Personally, I would just watch catalinas log for a specific string depending on how your setup and what exact phase your looking for.

    0 讨论(0)
  • 2020-12-24 14:09

    There are probably several ways to do this. The trick we use is:

    #!/bin/bash
    
    until [ "`curl --silent --show-error --connect-timeout 1 -I http://localhost:8080 | grep 'Coyote'`" != "" ];
    do
      echo --- sleeping for 10 seconds
      sleep 10
    done
    
    echo Tomcat is ready!
    

    Hope this helps!

    0 讨论(0)
提交回复
热议问题