tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgeny Goldin <evge...@gmail.com>
Subject Re: Running Tomcat as service - is it possible to make "tomcat7.exe" run a batch file each time it starts?
Date Sun, 06 Mar 2011 22:41:13 GMT


billybob79 wrote:
> 
>> Back when it was running through "startup.bat" we put some code in
> "catalina.bat" which is now ignored by "tomcat7.exe".
> 
> What is it that you are trying to achieve? What does this "code" do? Maybe
> if you explain a little more, someone might have achieved the same thing
> already in a different way
> 

I run Groovy to make some machine-specific replacements in some files
according to properties file which can be configured prior to starting
Tomcat. We have Artifactory and Jenkins deployed to Tomcat. This property
file contains various configurations to them and Groovy script, started from
"catalina.bat", reads and makes replacements in Tomcat config (one of
properties is "port #"), host name (one of properties is "localhost" which
should be replaced by full host name with "InetAddress.
http://download.oracle.com/javase/6/docs/api/java/net/InetAddress.html#getLocalHost()
localHost .
http://download.oracle.com/javase/6/docs/api/java/net/InetAddress.html#getCanonicalHostName()
canonicalHostName "), etc. So that's the code, to run some Groovy script
before Tomcat starts the applications.

Right, I'll try "cmd.exe" as service target and then will run either
"catalina.bat" or "tomcat7.exe" from my batch. Btw, which one is better or
more correct to run here?
-- 
View this message in context: http://old.nabble.com/Running-Tomcat-as-service---is-it-possible-to-make-%22tomcat7.exe%22-run-a-batch-file-each-time-it-starts--tp31081552p31083468.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message