Hi
> During boot the script /sbin/init.d/hpws_tomcat is run. It uses :
> su www -c "$HPWS_TOMCAT_HOME/bin/startup.sh 1>/dev/null 2>&1"
Hmm, does the "su www -c..." read the environment of the www user?
Florian
This is a discussion on tomcat 5 on HP-UX don't start at boot, but from command line - HP UX ; I am on a HP-UX computer trying to get tomcat 5 running on port 8081 as user www. We can start it from a command line, but not get it to run when the computer boots. $ uname -a HP-UX ...
I am on a HP-UX computer trying to get tomcat 5 running on port 8081 as
user www.
We can start it from a command line, but not get it to run when the
computer boots.
$ uname -a
HP-UX **** B.11.11 U 9000/800
$ /opt/java1.5/bin/java -version
java version "1.5.0.01"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.5.0.01-_06_jun_2005_05_20)
Java HotSpot(TM) Server VM (build 1.5.0.01 jinteg:06.06.05-04:39 PA2.0
(aCC_AP), mixed mode)
During boot the script /sbin/init.d/hpws_tomcat is run. It uses :
su www -c "$HPWS_TOMCAT_HOME/bin/startup.sh 1>/dev/null 2>&1"
And report Tomcat is Started. How ever, it is not.
In order to test I added 2 programs to the hpws_tomcat script :
1) A java program that writs a time stamp into a log file
2) A small java "echo" server on port 4444
The time-stamp program works fine. The Echo-server does not start.
After boot, if I as root give the command
/sbin/init.d/hpws_tomcat start
Everything works just fine.
So this problem seams to be connected to java networking at boot.
Does any one have any ide about what could possibly be wrong?
I am not the only one with this problem I guess, but I have not seen
any
solutions:
http://www.mail-archive.com/tomcat-u.../msg82008.html
Hi
> During boot the script /sbin/init.d/hpws_tomcat is run. It uses :
> su www -c "$HPWS_TOMCAT_HOME/bin/startup.sh 1>/dev/null 2>&1"
Hmm, does the "su www -c..." read the environment of the www user?
Florian
Is the boot time start of tomcat happening before or after all the
networking startup?
rick jones
--
Wisdom Teeth are impacted, people are affected by the effects of events.
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Thanks for your sugestions.
su -c preserves the environment for root. I have tested with both su -
www - c and su www -c. All tomcat environment variables like JAVA_HOME;
CATALINA_HOME etc are set corectly in catalina.sh, I have checked that
by dumping env to a log file.
I can't realy tell if network is up, I am not that muxh of a
UNIX-admin, but apache starts fine as www-user just before tomcat. Also
I can log in to the computer with ssh before tomcat is started. (boot
takes long time and tomcat is started at the very end of boot).
Therefor this seams to be a specific Java networking problem at boot
time on HP-UX.
// Mattias_at_freefarm_se@yahoo.com
"Mattias"wrote:
>I am on a HP-UX computer trying to get tomcat 5 running on port 8081 as
>user www.
>We can start it from a command line, but not get it to run when the
>computer boots.
>
>$ uname -a
>HP-UX **** B.11.11 U 9000/800
>$ /opt/java1.5/bin/java -version
>java version "1.5.0.01"
>Java(TM) 2 Runtime Environment, Standard Edition (build
>1.5.0.01-_06_jun_2005_05_20)
>Java HotSpot(TM) Server VM (build 1.5.0.01 jinteg:06.06.05-04:39 PA2.0
>(aCC_AP), mixed mode)
>
>During boot the script /sbin/init.d/hpws_tomcat is run. It uses :
>su www -c "$HPWS_TOMCAT_HOME/bin/startup.sh 1>/dev/null 2>&1"
>And report Tomcat is Started. How ever, it is not.
>
>In order to test I added 2 programs to the hpws_tomcat script :
>1) A java program that writs a time stamp into a log file
>2) A small java "echo" server on port 4444
>
>The time-stamp program works fine. The Echo-server does not start.
>After boot, if I as root give the command
>/sbin/init.d/hpws_tomcat start
>Everything works just fine.
>
>So this problem seams to be connected to java networking at boot.
>
>Does any one have any ide about what could possibly be wrong?
>
>I am not the only one with this problem I guess, but I have not seen
>any
>solutions:
>http://www.mail-archive.com/tomcat-u.../msg82008.html
Mattias,
You might need change the star up script from "su www" to "su - www"
"su user" just switches to the new user, "su - user" switches to new
user and runs new users profiles.
Also had a similar issue some years ago with a different product.
It would start at boot time, then some of the process would
"disappear". Worked OK manually from the command line. We had to
"nohup" the command in the startup script to stop these processes
terminating when the rc process finished.
Regards,
Ted.
================================================== ============
| Ted Linnell|
| |
| Nunawading, Victoria , Australia |
================================================== ============
Well, I tested with both su - www - c and su www -c. with the same
result.
What is nohup?
"Mattias"wrote:
>Well, I tested with both su - www - c and su www -c. with the same
>result.
>
>What is nohup?
Normally if you start a process from your terminal session it will
terminate when you logoff, even if is has been put into the
background.
nohup prevents this happening. The process should keep running.
do "man nohup" for more details.
Regards,
Ted.
================================================== ============
| Ted Linnell|
| |
| Nunawading, Victoria , Australia |
================================================== ============
Ted was right. The problem has now been solved.
In catalina.sh we changed the beginning of the start command from:
"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
...
to:
exec $JAVA_WRAPPER $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \
...
The $JAVA_WRAPPER variable is set it /sbin/init.d/hpws_tomcat:
export JAVA_WRAPPER=nohup
Simple as that!
Thanks for all your help!
// Mattias