Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My task involves deploying a Java web application into a Tomcat 6.0.35 instance running on Debian Squeeze. As such, Tomcat is installed from package sources and the web application is deployed from a custom .deb package that puts the .war file into a directory below /opt and registers it with Tomcat by dropping a context XML (let's call it my-app.xml) into /etc/tomcat6/Catalina/localhost/. This works fine for the initial .deb install where the application is picked up by Tomcat's auto deployment mechanism and unpacked into /var/lib/tomcat6/webapps/.

When re-installing a newer version of the .deb, Tomcat will not update the application, though. It will only detect a change if I manually execute a

touch /etc/tomcat6/Catalina/localhost/my-app.xml

Even restarting Tomcat without touching my-app.xml has no effect.

my-app.xml looks like this:

<Context path="/my-app" docBase="/opt/my-app/my-app.war">
    <WatchedResource>/opt/my-app/my-app.war</WatchedResource>
</Context>

IMHO, this should watch for changes of the .war (which changes when I install the updated .deb).

Autodeploy is turned on in server.xml.

Any ideas?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Put the touch line into the post-install script of your deb file

share|improve this answer
    
I would have hoped to be able to solve this by configuration, but sure, this will do as a workaround. –  Thilo-Alexander Ginkel Jun 21 '12 at 11:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.