Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 79625 - tomcat 5.0.27-r4 missing /etc/env.d/21tomcat file
Summary: tomcat 5.0.27-r4 missing /etc/env.d/21tomcat file
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Jan Brinkmann (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-26 12:25 UTC by unlord
Modified: 2005-04-13 11:22 UTC (History)
2 users (show)

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 unlord 2005-01-26 12:25:45 UTC
I recently upgraded tomcat on a development machine and found that the CATALINA_HOME environment variable was no longer set.  I looked on an older development machine and found that this used to be set with the file /etc/env.d/21tomcat.  The contents of this file are as follows:

CATALINA_HOME=/opt/tomcat
CONFIG_PROTECT=/etc/tomcat
#CATALINA_LIBDIR=/usr/share/tomcat/lib
#CLASSPATH=${CATALINA_LIBDIR}
#ENV_VARS="CATALINA_LIBDIR"

I am not sure what the motivation was about removing this file, but many ant build.xml scripts depend on the CATALINA_HOME environment variable for locating the tomcat libraries and for using the built in ant tasks contained in $CATALINA_HOME/server/lib/catalina-ant.jar for deploying/undeploying particular applications.

Reproducible: Always
Steps to Reproduce:




Expected Results:  
At the very minimum, the ebuild should install the file /etc/env.d/21tomcat that
contains the following line:

CATALINA_HOME=/opt/tomcat
Comment 1 Bert Geens (theBlackDragon) 2005-01-31 12:52:09 UTC
$CATALINA_HOME is nog set in /etc/conf.d/tomcat5 .
Comment 2 unlord 2005-02-02 08:49:30 UTC
I will assume you meant "now set in /etc/conf.d/tomcat5".  This is correct, and is useful to the gentoo startup script that allows you to start and stop the tomcat5 service.

However, as I said in my bug report, it does not set the environment variable CATALINA_HOME.  It would be nice to have this set in the /etc/env.d/21tomcat file because then you could do something like this in your build.xml file:

<property environment="env"/>
<property name="tomcat.home" value="${env.CATALINA_HOME}"/>

<path id="tomcat.classpath">
  <pathelement location="${tomcat.home}/server/lib/catalina-ant.jar"/>
</path>

<taskdef name="list"
    classname="org.apache.catalina.ant.ListTask"
    classpathref="tomcat.classpath"/>

<target name="list">
  <list url="${tomcat.manager.url}"
      username="${tomcat.username}"
      password="${tomcat.password}"/>
</target>

Which would list all the installed web applications (running or otherwise).
Comment 3 Jan Brinkmann (RETIRED) gentoo-dev 2005-02-07 15:47:07 UTC
i'm now going to maintain tomcat. starting from tomorrow i'll start to work on this
Comment 4 unlord 2005-02-07 17:07:17 UTC
Thank you, this issue should be pretty easy to fix.  I simply created the file /etc/env.d/21tomcat with the following line:

CATALINA_HOME=/opt/tomcat5

I don't know what happens if you try to install multiple versions of tomcat on the same machine, e.g., tomcat-5.0.27 and tomcat-5.5.
Comment 5 Jan Brinkmann (RETIRED) gentoo-dev 2005-02-09 10:21:41 UTC
ok, added an env.d file for this version. it will be added to newer version as well as soon as they're ready. thanks for your report.
Comment 6 unlord 2005-04-13 10:49:10 UTC
I just went to upgrade my install of tomcat to 5.0.27-r4 and ran into a little problem.  It looks like the permissions are incorrectly set:

-rwxr-x---   1 root root   27 Apr 13 12:34 21tomcat

it should be:

-rw-r--r--   1 root root   27 Apr 13 12:34 21tomcat
Comment 7 Jan Brinkmann (RETIRED) gentoo-dev 2005-04-13 11:22:47 UTC
now the old ebuild also makes use of newenvd.