View previous topic :: View next topic |
Author |
Message |
green_buddy Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 08 Jan 2003 Posts: 115 Location: Bay Area, CA
|
Posted: Mon Feb 24, 2003 11:35 pm Post subject: tomcat rc-script |
|
|
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
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 |
|
![](templates/gentoo/images/spacer.gif) |
green_buddy Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 08 Jan 2003 Posts: 115 Location: Bay Area, CA
|
Posted: Tue Feb 25, 2003 3:32 pm Post subject: |
|
|
Doh!!!
So I forgot to add this at the beginning of the script...
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 |
|
![](templates/gentoo/images/spacer.gif) |
clockwise Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/201809042943e73f9c1eed4.jpg)
Joined: 24 Aug 2002 Posts: 152 Location: uk
|
Posted: Tue Feb 25, 2003 10:29 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
green_buddy Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 08 Jan 2003 Posts: 115 Location: Bay Area, CA
|
Posted: Tue Mar 04, 2003 12:25 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|