最近遇到个问题,有个线上的tomcat总是运行一会儿就自动停止了,莫名其妙的没有任何报错。
在网上搜了一下,发现是跟网上一篇文章同样的一个原因
原来罪魁祸首就是启动脚本里的一个 tail -f
tail -f shows the logs continuously so the script doesn’t finish it’s execution automatically. When the ssh connection timed out while my script was still running, shell killed it WITH IT’S CHILD PROCESSES - a Tomcat server among others and that was the whole problem.
把tail -f去掉,问题解决。