SLES11 what's the SUSE way to conf multiple Tomcat instances

What would be the SUSE way to configure multiple Tomcat instances (different CATALINA_BASE)?

I’d like to use the rpm included in the distribution, so it gets updated by SUSE.

I have opened a SR with support for this, while they’re taking their time, I’m doing whatever I can to advance this matter.

Thanks

Hi silviumc,

[QUOTE=silviumc;22619]What would be the SUSE way to configure multiple Tomcat instances (different CATALINA_BASE)?

I’d like to use the rpm included in the distribution, so it gets updated by SUSE.

I have opened a SR with support for this, while they’re taking their time, I’m doing whatever I can to advance this matter.

Thanks[/QUOTE]

looking at /etc/init.d/tomcat6, it looks as if you’re expected to create i.e. symlinks to that script under the name of the different Tomcat instances:

[CODE]NAME=“$(basename $0)”
unset ISBOOT
if [ “${NAME:0:1}” = “S” -o “${NAME:0:1}” = “K” ]; then
NAME=“${NAME:3}”
ISBOOT=“1”
fi

remove SUSE’s rc name

if [ “${NAME:0:2}” = “rc” ]; then
NAME=“${NAME:2}”
fi

For SELinux we need to use ‘runuser’ not ‘su’

if [ -x “/sbin/runuser” ]; then
SU=“/sbin/runuser”
else
SU=“/bin/su”
fi

Get the tomcat config (use this for environment specific settings)

TOMCAT_CFG=“/etc/tomcat6/tomcat6.conf”
if [ -r “$TOMCAT_CFG” ]; then
. $TOMCAT_CFG
fi

Get instance specific config file

if [ -r “/etc/sysconfig/${NAME}” ]; then
. /etc/sysconfig/${NAME}
fi[/CODE]

The according configuration then goes into /etc/sysconfig/yourname (best start off with a copy of /etc/sysconfig/tomcat6).

I have opened a SR with support for this, while they’re taking their time, I’m doing whatever I can to advance this matter.

If you feel that you have been kept waiting for an excessive amount of time, there’s the “talk to a SUSE Technical Services Manager” forum to report: https://forums.suse.com/forumdisplay.php?55-Talk-to-a-SUSE-Technical-Services-Manager

Regards,
Jens

In the meantime I started looking at /etc/init.d/tomcat6 and figured out that you need to make a copy of it with a different name, like /etc/init.d/tomcat6_instance2, edit “Provides” and so on.

Also copy /etc/sysconfig/tomcat6 to /etc/sysconfig/tomcat6_instance2.

This is the way it’s supposed to work.

But actually, it’s a disastruous train wreck.

The initscript is supposed to create directories for a second instance and copy necessary files. They way it does that, whenever SUSE issues an update for the .rpm, the second instance does not get updated! Distro updates are the sole reason I wanted to use the SUSE rpm.

Not giving up, I erased all that ******** and went to manually creating symlinks the proper way, so that all the instances are using the same binary but have different configuration files.

It’s working beautifully now.

The SUSE idea from /etc/init.d/tomcat6 was good, but the execution was awful. No documentation anywhere, config files missing essential parameters (you must specify TOMCAT_CFG in /etc/sysconfg/tomcat6_instance2, otherwise dtomcat6 tries to start the first instance all the time), no love for old Tomcat6.