Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 406285 - Adapt www-servers/tomcat-6 init script to support multiple instances
Summary: Adapt www-servers/tomcat-6 init script to support multiple instances
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: PATCH
Depends on: 428002
Blocks:
  Show dependency tree
 
Reported: 2012-02-29 12:19 UTC by Miguel Angel Tormo
Modified: 2012-12-07 16:51 UTC (History)
0 users

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


Attachments
Replaces tomcat-6 with ${SVCNAME} (tomcat.init.patch,1.53 KB, patch)
2012-02-29 12:19 UTC, Miguel Angel Tormo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miguel Angel Tormo 2012-02-29 12:19:02 UTC
Created attachment 303719 [details, diff]
Replaces tomcat-6 with ${SVCNAME}

Current init.d script does not allow several instances of tomcat running at the same time but just because of the hardcoded pidfile. Making it dependant on the SVCNAME does the trick.

The instructions to configure an additional instance (named for example "mytomcat6") of tomcat would be something like this:
 - Apply the attached patch to /etc/init.d/tomcat-6.
 - Make a symbolic link from /etc/init.d/tomcat-6 to /etc/init.d/mytomcat6.
 - Copy /etc/conf.d/tomcat-6 to /etc/conf.d/mytomcat6 and edit it. The following variables should be different for each instance:
   CATALINA_BASE
   CATALINA_TMPDIR
 - Create your new CATALINA_BASE analogous to the stock /var/lib/tomcat-6. Ensure tomcat owns the directories it needs to.
 - Edit your new tomcat instance configuration (server.xml) to change the listening ports (Server port, connectors, etc) to avoid conflicts with other instances.


The patch attached to this bug just replaces "tomcat-6" with "${SVCNAME}". It's equivalent to running "sed -i 's/tomcat-6/${SVCNAME}/g' /etc/init.d/tomcat-6" if you have the latest init.d script from portage (for example, with tomcat-6.0.35).


I have this setup working nicely with 6 different tomcat instances running at the same time on the same machine. Package versions in that system:
  sys-apps/openrc-0.9.8.4
  sys-apps/baselayout-2.0.3
  www-servers/tomcat-6.0.35
Comment 1 Ralph Sennhauser (RETIRED) gentoo-dev 2012-12-07 16:51:18 UTC
The ebuilds where rewritten to allow easy setup of multiple instances. Though the approach differs. See https://wiki.gentoo.org/wiki/Apache_Tomcat for more information.

Thanks for the report.