MG> des réponses sont mises en tête par le MG>
______________________________________________ 
Note de déni et de confidentialité
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> Date: Sat, 19 Mar 2011 10:49:34 +0100
> Subject: Re: [OT] Tomcat 7: manager application takes forever to deploy - or 
> not
> From: f...@one2team.com
> To: users@tomcat.apache.org
> 
> On Fri, Mar 18, 2011 at 22:45, Christopher Schultz
> <ch...@christopherschultz.net> wrote:
> [...]
> >
> > I'm interested to see how you are able to launch Tomcat and have your
> > script continue only after all webapps have been deployed.
> >
> 
> This is the code right now:
> 
> ----
> if [ "$1" = "start" ]; then
>         STARTDATE=$(date +%Y%m%d-%H%M)
>         STAMP="=== START $STARTDATE ==="
> 
>         cat >>"$LOGFILE" <<EOF
> 
> $STAMP
> 
> EOF
> 
>         echo -n "Starting Tomcat"
> 
>         ${JAVACMD} $JAVA_STARTUP_OPTS $JAVA_OPTS \
>                 -classpath "$CLASSPATH" $TOMCAT_OPTS \
>                 "$MAIN_CLASS" start >> "$LOGFILE" 2>&1 &
> 
>         echo $! > $CATALINA_PID
> 
>         MAXITERS=120
>         ITERS=0
> 
>         while true; do
>                 ITERS=$((ITERS+1))
>                 if [ $ITERS -gt $MAXITERS ]; then
>                         echo
>                         echo >&2 "BUG: Tomcat not started after
> $MAXITERS seconds!"
>                         exit 1
>                 fi
> 
>                 perl -ne "print if /^$STAMP$/ .. eof()" "$LOGFILE" | \
>                         egrep -q "^INFO: Server startup in [0-9]+ ms$"
> 
>                 RC=$?
> 
>                 if [ "$RC" = "0" ]; then
>                         break
>                 fi
>                 echo -n .
>                 sleep 1
>         done
> 
>         echo " Done (in $ITERS seconds)"
> [...]
> ----
> 
> It is with this script that I noticed the long deploying time of
> /manager. This is the only way I knew of until yesterday, when I
> noticed that the shutdown port only gets open after webapps are
> deployed. I'll switch to this technique (using netstat -ltn|grep -w
> $SHUTDOWN_PORT or something like that) since it is more reliable (and
> faster) than scanning the log file: the server startup message may
> change behind me... Ideally, of course, it'd be very nice if the
> BootStrap class had, said, a "fullstart" command: I wouldn't need any
> of these ;)
> 
> Ultimately, what I really want to do anyway is a startup sequence
> which starts Tomcat up only with the manager app, 

MG>A default Tomcat installation includes the manager. To add an instance of the
MG>Manager web application Context to a new host install the
MG>manager.xml context configuration file in the
MG>$CATALINA_BASE/conf/[enginename]/[hostname] folder. Here is an example:
MG>
<Context path="/manager" debug="0" privileged="true"
         docBase="/usr/local/kinetic/tomcat6/server/webapps/manager">
</Context>
MG>
and which deploys
> webapps the list of which I store in another place. The deploy command
> only returns after the app is fully deployed, which is good (and so
> does the undeploy command).

MG>http://mojo.codehaus.org/tomcat-maven-plugin/deployment.html
MG>tomcat-maven-plugin supports the following configuration attributes
MG>configurable war file folder called  warSourceDirectory
MG>configurable location for context.xml called contextFile
MG> running embedded tomcat from maven with command 
MG>mvn tomcat:run

> >> Third, what if you want to do SNMP monitoring
> >> (-Dcom.sun.management.snmp.port=xxx etc etc)? You can't with the
> >> bundled scripts. Why? If you set JAVA_OPTS appropriately, these
> >> JAVA_OPTS will also be used for shutdown... Which means you can't
> >> shutdown at all: EADDRINUSE. Unless you arrange for different
> >> JAVA_OPTS on startup and shutdown, which I don't need to do with my
> >> scripts.
> >
> > As Chuck suggests, you haven't read the documentation well enough
> > because catalina.sh has options to cover your situation described above.
> >
> 
> Indeed.
> 
> -- 
> Francis Galiegue
> ONE2TEAM
> Ingénieur système
> Mob : +33 (0) 683 877 875
> Tel : +33 (0) 178 945 552
> f...@one2team.com
> 40 avenue Raymond Poincaré
> 75116 Paris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
                                          

Reply via email to