等到tomcat完成启动

编程入门 行业动态 更新时间:2024-10-24 11:16:50
本文介绍了等到tomcat完成启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个脚本,需要在tomcat完成启动并准备开始部署应用程序之后运行.我正在使用$TOMCAT_HOME/bin/startup.sh,它会立即返回.我怎样才能等到tomcat完成启动?

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 which returns immediately. How can I wait until tomcat has finished starting up?

推荐答案

大概有几种方法可以做到这一点.我们使用的技巧是:

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

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

希望这会有所帮助!

更多推荐

等到tomcat完成启动

本文发布于:2023-11-26 16:53:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634439.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:tomcat

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!