You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2011/06/20 14:37:02 UTC

svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Author: rjung
Date: Mon Jun 20 12:37:01 2011
New Revision: 1137607

URL: http://svn.apache.org/viewvc?rev=1137607&view=rev
Log:
Slight improvement of configtest handling in
Unix shell script:

- add to usage
- don't use CATALINA_OPTS (think memory size etc.)
- log a message if status != 0

Modified:
    tomcat/trunk/bin/catalina.sh

Modified: tomcat/trunk/bin/catalina.sh
URL: http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.sh?rev=1137607&r1=1137606&r2=1137607&view=diff
==============================================================================
--- tomcat/trunk/bin/catalina.sh (original)
+++ tomcat/trunk/bin/catalina.sh Mon Jun 20 12:37:01 2011
@@ -482,13 +482,17 @@ elif [ "$1" = "stop" ] ; then
 
 elif [ "$1" = "configtest" ] ; then
 
-    eval \"$_RUNJAVA\" $JAVA_OPTS $CATALINA_OPTS \
+    eval \"$_RUNJAVA\" $JAVA_OPTS \
       -Djava.endorsed.dirs=\"$JAVA_ENDORSED_DIRS\" -classpath \"$CLASSPATH\" \
       -Dcatalina.base=\"$CATALINA_BASE\" \
       -Dcatalina.home=\"$CATALINA_HOME\" \
       -Djava.io.tmpdir=\"$CATALINA_TMPDIR\" \
       org.apache.catalina.startup.Bootstrap configtest 
-    exit $?
+    result=$?
+    if [ $result -ne 0 ]; then
+        echo "Configuration error detected!"
+    fi
+    exit $result
 
 elif [ "$1" = "version" ] ; then
 
@@ -516,6 +520,7 @@ else
   echo "  stop n            Stop Catalina, waiting up to n seconds for the process to end"
   echo "  stop -force       Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running"
   echo "  stop n -force     Stop Catalina, wait up to n seconds and then use kill -KILL if still running"
+  echo "  configtest        Run a basic syntax check on server.xml - check exit code for result"
   echo "  version           What version of tomcat are you running?"
   echo "Note: Waiting for the process to end and use of the -force option require that \$CATALINA_PID is defined"
   exit 1



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


Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Posted by Rainer Jung <ra...@kippdata.de>.
On 20.06.2011 16:06, Mladen Turk wrote:
> On 06/20/2011 03:53 PM, Rainer Jung wrote:
>> On 20.06.2011 15:41, Mladen Turk wrote:
>>
>> In general all commands except those that start a Tomcat (and thus
>> deploy webapps etc.) should not use that type of params. They should go
>> into CATALINA_OPTS. Everything that you can use multiple times in
>> parallel, even for the helper programs can go in JAVA_OPTS.
>>
> 
> Hmm, make sense.
> Seems there is general missunderstanding of those two.
> People usually put in JAVA_OPTS what actually belongs to CATALINA_OPTS.
> 
> Dunno what to think actually at the moment.

Yes, I always thought the names are confusing. But probably much to late
now. The split was introduced long ago in TC 6 times.

If we change it, we break peoples config who set them in setenv.

One can make some sense out of the name: CATALINA_OPTS are the ones that
CATALINA=Tomcat needs to run.

Regards,

Rainer

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


Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
On 6/20/2011 8:06 AM, Mladen Turk wrote:
> On 06/20/2011 03:53 PM, Rainer Jung wrote:
>> On 20.06.2011 15:41, Mladen Turk wrote:
>>
>> In general all commands except those that start a Tomcat (and thus
>> deploy webapps etc.) should not use that type of params. They should go
>> into CATALINA_OPTS. Everything that you can use multiple times in
>> parallel, even for the helper programs can go in JAVA_OPTS.
>>
>
> Hmm, make sense.
> Seems there is general missunderstanding of those two.
> People usually put in JAVA_OPTS what actually belongs to CATALINA_OPTS.
don't matter what people put where, as long as we don't break backwards compatibility.

as long as configtest doesn't rely on system variables that can be put CATALINA_OPTS, such as -Dhttp.port=8080 :)



>
> Dunno what to think actually at the moment.
>
> Regards


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


Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Posted by Mladen Turk <mt...@apache.org>.
On 06/20/2011 03:53 PM, Rainer Jung wrote:
> On 20.06.2011 15:41, Mladen Turk wrote:
>
> In general all commands except those that start a Tomcat (and thus
> deploy webapps etc.) should not use that type of params. They should go
> into CATALINA_OPTS. Everything that you can use multiple times in
> parallel, even for the helper programs can go in JAVA_OPTS.
>

Hmm, make sense.
Seems there is general missunderstanding of those two.
People usually put in JAVA_OPTS what actually belongs to CATALINA_OPTS.

Dunno what to think actually at the moment.

Regards
-- 
^TM

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


Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Posted by Rainer Jung <ra...@kippdata.de>.
On 20.06.2011 15:41, Mladen Turk wrote:
> On 06/20/2011 03:28 PM, Mark Thomas wrote:
>> On 20/06/2011 14:21, Mladen Turk wrote:
>>> Just don't see what was the problem with that option that
>>> would require it to go away. This wasn't discussed on the dev list
>>> so if I weren't tracking the svn commits it would be a big surprise on
>>> the next tomcat release.
>>
>> Look at the patch again. It only removes the option for configtest
>>
> 
> It depends what you have in CATALINA_OPTS.
> If you have -d32/-d64 this won't get picked.
> However still don't get it why it was removed?
> 
> Funny, but I was actually trying to add $CATALINA_OPTS
> to the version command, so we get consistent JVM behavior.

We do have two options, JAVA_OPTS and CATALINA_OPTS. The only difference
between them is, for which of the catalina.sh subcommand they are used.

- JAVA_OPTS for all
- CATALINA_OPTS only for starting (and run and debug)

Why are there 2 option lists?

Because at least for the memory sizing you need to have a split. If you
run production tomcat with say 2GB heap, and add the same flag when
running version or stop, then you will temporrarily try to start another
2GB Java process.

Another example are the jmx listeners. If you add a port via the sun
management system property and add it to the stop or version command as
well, the JVM will not be able to start, so the version or stop command
will fail.

In general all commands except those that start a Tomcat (and thus
deploy webapps etc.) should not use that type of params. They should go
into CATALINA_OPTS. Everything that you can use multiple times in
parallel, even for the helper programs can go in JAVA_OPTS.

Regards,

Rainer

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


Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/6/20 Mladen Turk <mt...@apache.org>:
>>
>> Look at the patch again. It only removes the option for configtest
>>
>
> It depends what you have in CATALINA_OPTS.
> If you have -d32/-d64 this won't get picked.
> However still don't get it why it was removed?
>
> Funny, but I was actually trying to add $CATALINA_OPTS
> to the version command, so we get consistent JVM behavior.
>

-d32/-d64 flag should go into JAVA_OPTS, so that stop command were
using it as well.

Maybe let version command to print out the content of
JAVA_OPTS and CATALINA_OPTS variables?

Best regards,
Konstantin Kolinko

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


Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Posted by Mladen Turk <mt...@apache.org>.
On 06/20/2011 03:28 PM, Mark Thomas wrote:
> On 20/06/2011 14:21, Mladen Turk wrote:
>> Just don't see what was the problem with that option that
>> would require it to go away. This wasn't discussed on the dev list
>> so if I weren't tracking the svn commits it would be a big surprise on
>> the next tomcat release.
>
> Look at the patch again. It only removes the option for configtest
>

It depends what you have in CATALINA_OPTS.
If you have -d32/-d64 this won't get picked.
However still don't get it why it was removed?

Funny, but I was actually trying to add $CATALINA_OPTS
to the version command, so we get consistent JVM behavior.


Regards
-- 
^TM

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


Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Posted by Mark Thomas <ma...@apache.org>.
On 20/06/2011 14:21, Mladen Turk wrote:
> Just don't see what was the problem with that option that
> would require it to go away. This wasn't discussed on the dev list
> so if I weren't tracking the svn commits it would be a big surprise on
> the next tomcat release.

Look at the patch again. It only removes the option for configtest

Mark



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


Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Posted by Mladen Turk <mt...@apache.org>.
On 06/20/2011 03:16 PM, Rainer Jung wrote:
> On 20.06.2011 14:56, Mladen Turk wrote:
>> On 06/20/2011 02:37 PM, rjung@apache.org wrote:
>>> Author: rjung
>>> Date: Mon Jun 20 12:37:01 2011
>>> New Revision: 1137607
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1137607&view=rev
>>> Log:
>>> Slight improvement of configtest handling in
>>> Unix shell script:
>>>
>>> - add to usage
>>> - don't use CATALINA_OPTS (think memory size etc.)
>>
>> Why have you choose to kill all of the existing scripts out there?
>
> I haven't ;)
>

Yes you did. I have a bunch of users that really on CATALINA_OPTS
to get passed to the tomcat. Now that's gone :(

See the catalina.sh comment (still there)
#
#   CATALINA_OUT    (Optional) Full path to a file where stdout and stderr
#                   will be redirected.
#                   Default is $CATALINA_BASE/logs/catalina.out
#
#   CATALINA_OPTS   (Optional) Java runtime options used when the "start",
#                   or "run" command is executed.
#
#   CATALINA_TMPDIR (Optional) Directory path location of temporary directory
#                   the JVM should use (java.io.tmpdir).  Defaults to
#                   $CATALINA_BASE/temp.


Just don't see what was the problem with that option that
would require it to go away. This wasn't discussed on the dev list
so if I weren't tracking the svn commits it would be a big surprise on
the next tomcat release.


Cheers
-- 
^TM

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


Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Posted by Rainer Jung <ra...@kippdata.de>.
On 20.06.2011 14:56, Mladen Turk wrote:
> On 06/20/2011 02:37 PM, rjung@apache.org wrote:
>> Author: rjung
>> Date: Mon Jun 20 12:37:01 2011
>> New Revision: 1137607
>>
>> URL: http://svn.apache.org/viewvc?rev=1137607&view=rev
>> Log:
>> Slight improvement of configtest handling in
>> Unix shell script:
>>
>> - add to usage
>> - don't use CATALINA_OPTS (think memory size etc.)
> 
> Why have you choose to kill all of the existing scripts out there?

I haven't ;)

> -jpda won't work any more.
> 
> Please revert that part.

I'll check.

Rainer

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


Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Posted by Rainer Jung <ra...@kippdata.de>.
On 20.06.2011 14:56, Mladen Turk wrote:
> On 06/20/2011 02:37 PM, rjung@apache.org wrote:
>> Author: rjung
>> Date: Mon Jun 20 12:37:01 2011
>> New Revision: 1137607
>>
>> URL: http://svn.apache.org/viewvc?rev=1137607&view=rev
>> Log:
>> Slight improvement of configtest handling in
>> Unix shell script:
>>
>> - add to usage
>> - don't use CATALINA_OPTS (think memory size etc.)
> 
> Why have you choose to kill all of the existing scripts out there?
> -jpda won't work any more.
> 
> Please revert that part.

Hmmm, after checking, I don't understand.

Did you see the "configtest" in the above log message?

This is not about "start", only about configtest.sh.

So do you have an actual problem with jpda or did you only think there
is a problem?

Regards,

Rainer

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


Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

Posted by Mladen Turk <mt...@apache.org>.
On 06/20/2011 02:37 PM, rjung@apache.org wrote:
> Author: rjung
> Date: Mon Jun 20 12:37:01 2011
> New Revision: 1137607
>
> URL: http://svn.apache.org/viewvc?rev=1137607&view=rev
> Log:
> Slight improvement of configtest handling in
> Unix shell script:
>
> - add to usage
> - don't use CATALINA_OPTS (think memory size etc.)

Why have you choose to kill all of the existing scripts out there?
-jpda won't work any more.

Please revert that part.




Regards
-- 
^TM

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