LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-08-2010, 01:18 PM   #1
tomwilsonfl
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Rep: Reputation: 0
Tomcat startup PATH problems


We have a server that when restarted automatically starts Tomcat.

One of the Java Apps on the Tomcat svr uses ImageMagick which is installed to /usr/local/bin

After a reboot, the exec() calls from the Java app cannot run "convert" (or any other binary) which are in /usr/local/bin

In order to make it work, it simply must be shutdown and restarted (as root obviously) using the same scripts that were run during the system startup.

What gives here? How do I see what environment is being used to startup the server and why would /usr/local/bin not be in the PATH during startup?

Thanks and peace,
Tom
 
Old 01-08-2010, 01:34 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
What OS / version? Can you post the startup script?
 
Old 01-08-2010, 01:47 PM   #3
tomwilsonfl
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
RH 4 ES

Code:
#!/bin/sh
# chkconfig: 03456 99 01
# description: Tomcat startup/shutdown script

CATALINA_HOME=/usr/local/tomcat
export JAVA_HOME=/usr/java/latest

case $1 in
'start')
        # START TOMCAT
        echo "Starting Tomcat"
        $CATALINA_HOME/bin/startup.sh &
        ;;
'stop')
        # STOP TOMCAT
        echo "Stopping Tomcat"
        $CATALINA_HOME/bin/shutdown.sh &
        ;;
*)
        echo "usage: $0 {start|stop}"
        exit
        ;;
esac
exit

Thanks,
Tom
 
Old 01-08-2010, 01:54 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Try explicitly setting the PATH in the script.

Code:
export PATH=${PATH}:/usr/local/bin
Probably there is something extra in root's full PATH that is not in place at boot time (when the init script is run).

-------

BTW, you normally do not run Tomcat as root. You might want to look at your whole application design at some point and see if you can instead run as an unprivileged service account.

Last edited by anomie; 01-08-2010 at 01:56 PM.
 
Old 01-08-2010, 01:57 PM   #5
tomwilsonfl
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
An associate of mine just suggested that also. I will give it a try.

I've added some environment dumping to the startup script so I can compare ENVs.

Will report back.

Thanks,
Tom
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tomcat 5 Startup warnings tatacalu Linux - Server 1 12-27-2006 10:33 AM
how to get Tomcat to run on startup? TrevorS Slackware 8 09-19-2006 10:24 PM
tomcat startup on boot malbery Linux - Software 3 01-27-2005 04:10 PM
tomcat path? cz1179 Linux - General 1 01-05-2005 02:13 PM
TOMCAT init script not working on startup -- tomcat 4.x / Mandrake Linux 8.0 jmartinph Mandriva 0 03-08-2004 01:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration