Operating System - HP-UX
1830932 Members
2515 Online
110017 Solutions
New Discussion

Re: Tomcat Start On Boot: Final Question

 
SOLVED
Go to solution
Karl Balsmeier
Advisor

Tomcat Start On Boot: Final Question

Hi there,

A while back I posted a question about getting the Non-HP-Depot version of Tomcat 4.0.6, which is from Apache Software Foundation, to automatically start on reboot.

At the time, everyone noted the importance of getting the environment & path variables set properly, which is where I discovered that an old version of java (/opt/java-1.3/jre) was being called from /sbin/init.d/tomcat. The proper version is /opt/java1.4.

While trying to solve this from a purely sysadmin standpoint, it was revealed to me that if I called out my environment variables in /etc/rc.config.d/tomcat instead of /sbin/init.d/tomcat, all the better.

My question is this, can I leave the syntax as follows using "export", or should I be using "set env"?
====================
PATH=/usr/sbin:/usr/bin:/sbin:/opt/tomcat4.0.6/bin

export PATH
export JAVA_HOME=/opt/java1.4
export BASEDIR=/opt/tomcat4.0.6
export CATALINA_HOME=$BASEDIR
export JAVA_OPTS="Xms128m -Xmx256m"
export DISPLAY=node1.our.domain:0.0

Any input would be most appreciated!

-karlski
"Unix is the Net"
4 REPLIES 4
Steven E. Protter
Exalted Contributor
Solution

Re: Tomcat Start On Boot: Final Question

Not having done this:

From the sysadmin viewpoint, there is no need to change your export procedure.

I am anal, and break up my commands as follows:

JAVA_HOME=/opt/java1.4
export JAVA_HOME

Thats just because I'm a little mental, but once had a problem with the single line export establish statement.

/etc/rc.config.d/ is for environment variables /sbin/init.d is for scripts that use those variables

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Karl Balsmeier
Advisor

Re: Tomcat Start On Boot: Final Question

So, the final product, should look something like:

PATH=/usr/sbin:/usr/bin:/sbin:/opt/tomcat4.0.6/bin
export PATH

export JAVA_HOME=/opt/java1.4
export $JAVA_HOME

export CATALINA_HOME=/opt/tomcat4.0.6
export $CATALINA_HOME

export JAVA_OPTS="Xms128m -Xmx256m"

export DISPLAY=node1.our.domain:0.0

1. Should I be using the dollar sign as I have above, or should I remove it?

2. I notice my PATH doesn't include JAVA_HOME like it does CATALINA_HOME, should I add it like I did Java?
"Unix is the Net"
A. Clay Stephenson
Acclaimed Contributor

Re: Tomcat Start On Boot: Final Question

Always leave the "$" off the export command. You do not want the variable to be instantiated.

If it ain't broke, I can fix that.
Karl Balsmeier
Advisor

Re: Tomcat Start On Boot: Final Question

You guys truly rule!

Guess what, I just did a ps m-ef | grep java to check what java version to really use, and voila, it notes /opt/java1.3/jre/bin, so I added it, removed the $ signs, and now the final question.

Is it OK to just use these in /etc/rc.config.d/tomcat? Or is it essential to keep them in /sbin/init.d/tomcat, I notice Stephen responded to this, just getting my comprehension down :P

Now, we have an /etc/rc.config.d/tomcat that says:

PATH=/usr/sbin:/usr/bin:/sbin:/opt/tomcat4.0.6/bin:/opt/java1.3/jre/bin
export PATH

export JAVA_HOME=/opt/java1.3/jre/bin
export JAVA_HOME

export CATALINA_HOME=/opt/tomcat4.0.6
export CATALINA_HOME

export JAVA_OPTS="Xms128m -Xmx256m"

export DISPLAY=node1.our.domain:0.0

How's it lookin from the laureled heights?

-karlski
"Unix is the Net"