我使用ant(sshexec)启动远程tomcat
<sshexec host="${ssh.hostname}" port="${ssh.port}"
username="${ssh.username}" password="${ssh.password}" trust="true"
command="${tomcat.home}/bin/startup.sh" />
但是在tomcat启动成功后,ant不会退出。
我使用cronolog来处理tomcat的日志:catalina.out,像这样改变catalina.sh:
org.apache.catalina.startup.Bootstrap "$@" start 2>&1 \
| /usr/local/sbin/cronolog "$CATALINA_BASE"/logs/catalina.%Y-%m-%d.out >> /dev/null &
当我回滚catalina.sh时:
org.apache.catalina.startup.Bootstrap "$@" start \
>> "$CATALINA_OUT" 2>&1 &
.... Ant会好的
startTomcat:
[echo] start tomcat in 10.10.2.174...
[sshexec] Connecting to 10.10.2.174:22
[sshexec] cmd : /opt/tomcat6/bin/startup.sh
BUILD SUCCESSFUL
Total time: 11 seconds
为什么cronolog会导致蚂蚁挂起