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
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.