0

I use ant(sshexec) to start remote tomcat

<sshexec host="${ssh.hostname}"  port="${ssh.port}" 
                    username="${ssh.username}"  password="${ssh.password}"  trust="true"  
                    command="${tomcat.home}/bin/startup.sh" />

But ant will't exit after tomcat startup successful。

I use cronolog to process tomcat's log: catalina.out,change catalina.sh like this:

      org.apache.catalina.startup.Bootstrap "$@" start 2>&1 \
  | /usr/local/sbin/cronolog "$CATALINA_BASE"/logs/catalina.%Y-%m-%d.out >> /dev/null &  

When I rollback catalina.sh:

org.apache.catalina.startup.Bootstrap "$@" start \
   >> "$CATALINA_OUT" 2>&1 &

.... Ant will be OK

    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

Why cronolog will cause ant hung

  • Are you sure the same startup.sh with "cronolog" command line starts tomcat in background at your local machine and from a remote SSH shell? – Dante WWWW Nov 24 '13 at 12:59
  • yes, I run startup.sh and shutdown.sh in one ant script, startup.sh can work, ant do next target. shutdown.sh is the last target, will never finish... – jay61439476 Nov 29 '13 at 01:19

0 Answers0