I use the following in ${CATALINA_HOME}/conf/setenv.sh:

#!/bin/sh
if [ "$1" = "start" ] ; then
    CATALINA_OPTS="$CATALINA_OPTS \
        -Dcom.sun.management.jmxremote \
        -Dcom.sun.management.jmxremote.port=9086 \
        -Dcom.sun.management.jmxremote.ssl=false \
        -Dcom.sun.management.jmxremote.authenticate=false"
    echo $0: CATALINA_OPTS = "$CATALINA_OPTS"
fi

HTH,
Tim

> -----Original Message-----
> From: David Delbecq [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 20, 2006 10:26 AM
> To: Tomcat Users List
> Subject: Re: How do I pass option to Tomcat on startup only?
> 
> Hello,
> JAVA_OPTS is an environnement variable, you can set / unset it at will.
> Just only set it up when you want to start, not when you want to shutdown.
> 
> Example 1 (using only 1 bash session)
> export  JAVA_OPTS="-Xmanagement"
> bin/startup.sh
> unset JAVA_OPTS
> bin/shutdown.sh
> 
> Example 2 (using 2 different bash sessions)
> bash1$ export  JAVA_OPTS="-Xmanagement"
> bash1$ bin/startup.sh
> bash2$ bin/shutdown.sh
> 
> Daniel Serodio wrote:
> > I'm running Tomcat on Linux, and I want to enable the JMX agent
> > (-Xmanagement).
> > If I add "-Xmanagement" to the JAVA_OPTS variable, this option will be
> > passed to the JVM both on Tomcat startup _and_ shutdown.
> > The problem is that when I try to shutdown Tomcat, the -Xmanagement
> > option is passed to the Shutdown process, which can't listen on the JMX
> > port because Tomcat is already listening.
> >
> > How can I pass the -Xmanagement option to Tomcat startup _only_, and not
> >  shutdown too.
> >
> > Thanks in advance,
> > Daniel Serodio
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to