Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
tomcat rc-script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
green_buddy
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jan 2003
Posts: 115
Location: Bay Area, CA

PostPosted: Mon Feb 24, 2003 11:35 pm    Post subject: tomcat rc-script Reply with quote

Hi everyone,

I recently realized that there is no reason for me to run an apache/tomcat server since tomcat will handle everything I'm going to need just fine and the apache/tomcat architecture doesn't allow some things that I want... namely all source under a single top level domain as opposed to how the apache/tomcat world seems to want jsp sources to live under tomcat and static sources to reside under apache... bleh! ;)

So since I had everything up and running as apache/tomcat I just did a...
Code:
rc-update del apache

That's just fine and dandy except that I can't seem to get tomcat to startup correctly when my gentoo box starts up and there doesn't seem to be an init.d script available for tomcat... really :?: 8O

I basically wrote my own, but it definitely doesn't seem to be working... for the curious - here it is:
Code:
depend() {
   need net
   use mysql dns logger
}

start() {
   ebegin "Starting tomcat"
   /opt/jakarta/tomcat/bin/startup.sh
}

stop() {
   ebegin "Stopping tomcat"
   /opt/jakarta/tomcat/bin/shutdown.sh
}

Does anyone know what I'm missing here? I was wondering if someone who has this working could post there rc-script?

Thanks,
-green
Back to top
View user's profile Send private message
green_buddy
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jan 2003
Posts: 115
Location: Bay Area, CA

PostPosted: Tue Feb 25, 2003 3:32 pm    Post subject: Reply with quote

Doh!!! :oops:

So I forgot to add this at the beginning of the script...
Code:
#!/sbin/runscript


Gotta remember to do that for the runlevels rc-scripts! ;)

However, now I'm having a different problem. When the service starts up it says...
Quote:
The JAVA_HOME variable is not defined...


What service defines the JAVA_HOME (or any environment variable) so that I can put that in the depends clause as well?

-green
Back to top
View user's profile Send private message
clockwise
Apprentice
Apprentice


Joined: 24 Aug 2002
Posts: 152
Location: uk

PostPosted: Tue Feb 25, 2003 10:29 pm    Post subject: Reply with quote

i think environment variables are set from the "bootmisc" script, which runs from the "boot" runlevel. so, as long as tomcat is in default (or later) it should get them. is there a JAVA_HOME variable normally defined?

if you haven't tried it already take a look at:
Code:

$ java-config --jdk-home
/opt/sun-jdk-1.4.1.01

_________________
"if an injury has to be done to a man it should be so severe that his vengeance need not be feared." - niccolò machiavelli
Back to top
View user's profile Send private message
green_buddy
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jan 2003
Posts: 115
Location: Bay Area, CA

PostPosted: Tue Mar 04, 2003 12:25 am    Post subject: Reply with quote

clockwise wrote:
i think environment variables are set from the "bootmisc" script, which runs from the "boot" runlevel. so, as long as tomcat is in default (or later) it should get them. is there a JAVA_HOME variable normally defined?

if you haven't tried it already take a look at:
Code:

$ java-config --jdk-home
/opt/sun-jdk-1.4.1.01


Yeah, I had already tried that but nothing seems to have worked... so I've taken a bit of a different approach, and while I find it a little dirty, it works really well...

My /etc/init.d/tomcat...
Code:
#!/sbin/runscript

depend() {
        need net
        use mysql dns logger
}

start() {
        ebegin "Starting tomcat"
        /opt/jakarta/tomcat/bin/startup.sh &>/dev/null
        eend $?
}

stop() {
        ebegin "Stopping tomcat"
        /opt/jakarta/tomcat/bin/shutdown.sh &>/dev/null
        eend $?
}


I have /etc/env.d/21tomcat directly after my /etc/env.d/20java.

My /etc/env.d/21tomcat...
Code:
CATALINA_HOME=/opt/jakarta/tomcat
CONFIG_PROTECT=/opt/jakarta/tomcat/conf


Then in /etc/conf.d/tomcat...
Code:
# Config file for /etc/init.d/tomcat

export JAVA_HOME="/usr/java"


Where /usr/java is a symlink to /opt/sun-jdk-1.4.1.01/, but this isn't required and could just as easily be done without the symlink.

Don't forget to run
Code:
rc-update add tomcat default
to get everything working correctly so that it starts up with the rest of the other services on your machine.

I hope that helps.
-green
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum