Unix Technical Forum

tomcat 5 on HP-UX don't start at boot, but from command line

This is a discussion on tomcat 5 on HP-UX don't start at boot, but from command line within the HP-UX Operating System forums, part of the Unix Operating Systems category; --> I am on a HP-UX computer trying to get tomcat 5 running on port 8081 as user www. We ...


Go Back   Unix Technical Forum > Unix Operating Systems > HP-UX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 07:27 PM
Mattias
 
Posts: n/a
Default tomcat 5 on HP-UX don't start at boot, but from command line

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 07:27 PM
Florian Anwander
 
Posts: n/a
Default Re: tomcat 5 on HP-UX don't start at boot, but from command line

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 07:27 PM
Rick Jones
 
Posts: n/a
Default Re: tomcat 5 on HP-UX don't start at boot, but from command line

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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 07:27 PM
Mattias
 
Posts: n/a
Default Re: tomcat 5 on HP-UX don't start at boot, but from command line

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-16-2008, 07:28 PM
Ted Linnell
 
Posts: n/a
Default Re: tomcat 5 on HP-UX don't start at boot, but from command line

"Mattias" <mattias_at_freefarm_se@yahoo.com> 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 <edlinnell@acslink.net.au> |
| |
| Nunawading, Victoria , Australia |
================================================== ============
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-16-2008, 07:28 PM
Mattias
 
Posts: n/a
Default Re: tomcat 5 on HP-UX don't start at boot, but from command line

Well, I tested with both su - www - c and su www -c. with the same
result.

What is nohup?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-16-2008, 07:28 PM
Ted Linnell
 
Posts: n/a
Default Re: tomcat 5 on HP-UX don't start at boot, but from command line

"Mattias" <mattias_at_freefarm_se@yahoo.com> 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 <edlinnell@acslink.net.au> |
| |
| Nunawading, Victoria , Australia |
================================================== ============
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-16-2008, 07:28 PM
Mattias
 
Posts: n/a
Default Re: tomcat 5 on HP-UX don't start at boot, but from command line

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:00 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com