Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 179119 - Tomcat init script should check if the current VM can run Tomcat
Summary: Tomcat init script should check if the current VM can run Tomcat
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-19 16:43 UTC by Petteri Räty (RETIRED)
Modified: 2007-05-21 07:45 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petteri Räty (RETIRED) gentoo-dev 2007-05-19 16:43:43 UTC
19:20 <@Betelgeuse> kky: java -version
19:21 < kky> java version "1.4.2-03" but when i've installed tomcat i've downloaded 1.5....
19:21 < kky> is it the problem ?
19:21 <@Betelgeuse> kky: Yes with USE="java5" you need to set system VM to 1.5
19:22 <@Betelgeuse> kky: or set GENTOO_VM in /etc/conf.d/tomcat-5.5
19:22 < kky> thx

The code for checking it is:
[[ $(gjl -p tomcat-5.5 --get-vm) ]]
Comment 1 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-05-19 16:58:40 UTC
Using [[ is not posix compliant in a init script.

Per bug 174498
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2007-05-19 17:12:27 UTC
(In reply to comment #1)
> Using [[ is not posix compliant in a init script.
> 
> Per bug 174498
> 

True. The POSIX version is

betelgeuse@pena ~ $ dash test.sh
Not valid
betelgeuse@pena ~ $ cat test.sh
#!/bin/dash
export GENTOO_VM="sun-jdk-1.4"
[ "$(gjl -p tomcat-5.5 --get-vm)" ] && echo Not valid

Comment 3 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-05-20 21:43:18 UTC
Fixed in 5.5.23-r4, closing bug.
Comment 4 Petteri Räty (RETIRED) gentoo-dev 2007-05-20 22:09:24 UTC
(In reply to comment #3)
> Fixed in 5.5.23-r4, closing bug.
> 

Thanks.
Comment 5 Petteri Räty (RETIRED) gentoo-dev 2007-05-20 22:28:56 UTC
(In reply to comment #3)
> Fixed in 5.5.23-r4, closing bug.
> 

Sorry did not want to make a full patch because I wasn't sure that you were going to use because of that discussion of ours but here are the errors in the version you committed:

pena eclass # /etc/init.d/tomcat-5.5 restart
tomcat-5.5  | * Caching service dependencies ...                                                                                                                                                         [ ok ]
tomcat-5.5  | * Stopping Tomcat ...
tomcat-5.5  |/etc/init.d/tomcat-5.5: line 8: error: command not found
tomcat-5.5  |/etc/init.d/tomcat-5.5: line 9: error: command not found
tomcat-5.5  |/etc/init.d/tomcat-5.5: line 10: error: command not found                                                                                                                                   [ ok ]
tomcat-5.5  | * Starting Tomcat ...
tomcat-5.5  |/etc/init.d/tomcat-5.5: line 8: error: command not found                                                                                                                                    [ !! ]
tomcat-5.5  |/etc/init.d/tomcat-5.5: line 9: error: command not found
tomcat-5.5  |/etc/init.d/tomcat-5.5: line 10: error: command not found     

it's called eerror

I should have also said that gjl relies on the system VM setting and as such is not valid in 5.5 when the conf.d file uses JAVA_HOME so the conf.d file needs to be changed to use GENTOO_VM.
Comment 6 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-05-20 23:34:41 UTC
(In reply to comment #5)
>
> Sorry did not want to make a full patch because I wasn't sure that you were
> going to use because of that discussion of ours

Where I also expressed I made recent efforts to close as many Tomcat bugs as possible.

 but here are the errors in the
> version you committed:

Typo, left of an e. It's been corrected.

> I should have also said that gjl relies on the system VM setting and as such is
> not valid in 5.5 when the conf.d file uses JAVA_HOME so the conf.d file needs
> to be changed to use GENTOO_VM.

That would have been nice to be mentioned. However I had migrated 6.0.x to GENTOO_VM and thought I did 5.5.x when I had to make a new init script and conf.d file. Looks as if I did not, so I just migrated them, and got them in sync with the changes I made to 6.0.x.
 
Comment 7 Petteri Räty (RETIRED) gentoo-dev 2007-05-21 07:45:29 UTC
(In reply to comment #6)
> 
> That would have been nice to be mentioned. However I had migrated 6.0.x to
> GENTOO_VM and thought I did 5.5.x when I had to make a new init script and
> conf.d file. Looks as if I did not, so I just migrated them, and got them in
> sync with the changes I made to 6.0.x.
> 

Yes. That's what I thought too but had I written the complete patch I would have noticed.