But when my slack box reboots, the tomcat server cannot get launched.
But I can login to the server and manually do the job:
/etc/rc.d/rc.tomcat start
What prevent tomcat from starting in boot time? Thanks.
--
Life is the only flaw in an otherwise perfect nonexistence
-- Schopenhauer
narke
> I put a rc.tomcat script under /etc/rc.d and make it executable. The
> script can launch tomcat server: /opt/apache-tomcat/bin/startup.sh
>
> But when my slack box reboots, the tomcat server cannot get launched.
> But I can login to the server and manually do the job:
> /etc/rc.d/rc.tomcat start
>
> What prevent tomcat from starting in boot time? Thanks.
Because nothing in the startup scripts knows there is a rc.tomcat script
there... You need to tell it to start, by calling it from rc.local.
Add this to /etc/rc.d/rc.local :
### Start Tomcat server
if [ -x /etc/rc.d/rc.tomcat ]; then
/etc/rc.d/rc.tomcat start
fi
--
"Ubuntu" -- an African word, meaning "Slackware is too hard for me".
"Bother!" said Pooh, as he puked on Christopher Robin.
Usenet Improvement Project: http://twovoyagers.com/improve-usenet.org/
Thanks, Obama: http://brandybuck.site40.net/pics/politica/thanks.jpg
It sounds like an environment issue. Did you check Tomcat's error logs?
It probably has a hint on why it couldn't start up.
--keith
--
kkeller...@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information
Du meintest am 20.09.10:
> I put a rc.tomcat script under /etc/rc.d and make it executable. The
> script can launch tomcat server: /opt/apache-tomcat/bin/startup.sh
> But when my slack box reboots, the tomcat server cannot get launched.
> But I can login to the server and manually do the job:
> /etc/rc.d/rc.tomcat start
> What prevent tomcat from starting in boot time? Thanks.
Nearly every "rc.xyz" script in "/etc/rc.d" has to be called by another
"rc.zyx" script. Take a look at "rc.M"; and there you can see the call
for "rc.local".
If you add a line
test -x /etc/rc.d/rc.tomcat && /etc/rc.d/rc.tomcat
in "/etc/rc.d/rc.local" then the machine should do what you want.
Viele Gruesse
Helmut
"Ubuntu" - an African word, meaning "Slackware is too hard for me".
On 2010-09-20, Helmut Hullen <Hel...@Hullen.de> wrote:
> If you add a line
>
> test -x /etc/rc.d/rc.tomcat && /etc/rc.d/rc.tomcat
>
> in "/etc/rc.d/rc.local" then the machine should do what you want.
That's a tad bit unreadable to a novice user such as the OP. The
syntax used by Slackware is much clearer.
rc.local
========
if [ -x /etc/rc.d/rc.tomcat ]; then
/etc/rc.d/rc.tomcat start
fi
To the OP: if you want or need to gracefully shut down tomcat when the
system goes through shutdown, add the following lines to
rc.local_shutdown (creating it and making it executable if necessary).
rc.local_shutdown
=================
if [ -x /etc/rc.d/rc.tomcat ]; then
/etc/rc.d/rc.tomcat stop
fi
- --
It is better to hear the rebuke of the wise,
Than for a man to hear the song of fools.
Ecclesiastes 7:5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkyXYcAACgkQDyaEVbMHxsaf7ACfVC6Www70fiwTmxBYhdOiY7Gq
exMAoKZuh+KQRhH8zY7iYqNTSoOPjo3l
=xFU5
-----END PGP SIGNATURE-----
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 2010-09-20, Helmut Hullen <Hel...@Hullen.de> wrote:
>> If you add a line
>>
>> test -x /etc/rc.d/rc.tomcat && /etc/rc.d/rc.tomcat
>>
>> in "/etc/rc.d/rc.local" then the machine should do what you want.
>
> That's a tad bit unreadable to a novice user such as the OP. The syntax
> used by Slackware is much clearer.
>
> rc.local
> ========
>
> if [ -x /etc/rc.d/rc.tomcat ]; then
> /etc/rc.d/rc.tomcat start
> fi
Which is exactly what I posted about 10 hours ago....
--
"Ubuntu" -- an African word, meaning "Slackware is too hard for me".
"Bother!" said Pooh, as he slipped his date a Purple Microdot.
> I put a rc.tomcat script under /etc/rc.d and make it executable. The
> script can launch tomcat server: /opt/apache-tomcat/bin/startup.sh
>
> But when my slack box reboots, the tomcat server cannot get launched.
> But I can login to the server and manually do the job:
> /etc/rc.d/rc.tomcat start
>
> What prevent tomcat from starting in boot time? Thanks.
Scripts in /etc/rc.d are not executed 'automagically'; they need some other
component to specifically and actively run them.
You have (at least) three choices:
1) Link your rc.tomcat to the appropriate /etc/rc.d/rc[0-6].d directory (or
directories, where the variable number [0-6] represents the runstate you
want your script to run in). This is the "SysVinit" way of running startup
scripts, and will be compatable with other (non-Slackware) distributions.
2) Leave your rc.tomcat in /etc/rc.d, and modify one of the other rc scripts
in /etc/rc.d to start it. Others have suggested this already, pointing out
options as to /which/ script you can modify to start (and stop)
your /etc/rc.d/rc.tomcat script,
3) Leave your rc.tomcat in /etc/rc.d, and modify your /etc/inittab to invoke
it at the proper point in your startup (and shutdown). This has the benefit
of permitting you to *properly* place your tomcat startup and shutdown
within order of things done, while not modifying any of the Slackware rc
scripts. The drawback is that single inittab entries have coarser control
over events than the scripts they invoke.
HTH
--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576
Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.ca/
---------- Slackware - Because I know what I'm doing. ------
Sorry, I forget to say that I've already put this in rc.M :) So this is
not the cause of the problem.
Thanks for the suggestion. Now it may be too later to check the log,
there have been already too many logs files in $CATALINA_HOME/logs.
Could you please tell me what log file the errors usually go?
Thanks for the suggestion of rc.local_shutdown, I like to do it now :)
Du meintest am 20.09.10:
>> Add this to /etc/rc.d/rc.local :
>>
>> ### Start Tomcat server
>> if [ -x /etc/rc.d/rc.tomcat ]; then
>> /etc/rc.d/rc.tomcat start
>> fi
>>
>>
> Sorry, I forget to say that I've already put this in rc.M :) So this
> is not the cause of the problem.
Then expand the lines:
if [ -x /etc/rc.d/rc.tomcat ]; then
set -x
export SHELLOPTS
/etc/rc.d/rc.tomcat start
set +x
read -p "press any key " dummy
fi
Viele Gruesse
Helmut
"Ubuntu" - an African word, meaning "Slackware is too hard for me".
> Sorry, I forget to say that I've already put this in rc.M :) So this is
> not the cause of the problem.
>
Where in rc.M did you put it? Somewhere in the middle of rc.M your network
hardware is initialized and configured, I think you would want to be after
the networking stuff.
--
Ed
It is _not_ a good idea to modify rc.M itself. Put the startup for
tomcat in "rc.local", that one will NOT get overwritten by the next
security update to the rc startup scripts.
--
******************************************************************
** Eef Hartman, Delft University of Technology, dept. SSC/ICT **
** e-mail: E.J.M....@tudelft.nl - phone: +31-15-27 82525 **
******************************************************************
And that is the other reason you don't want to modify rc.M, it basically
starts everything, so placement within that script is rather critical.
rc.local, being executed after everything else has been started, so
i.e. also the name server (when needed) and/or apache itself, is
the normal place for user additions.
When started from rc.local the environment variable
JAVA_HOME is not set, so you just need to start it this way:
export JAVA_HOME=/usr/lib/java
/opt/apache-tomcat/bin/startup.sh
enjoy
--
Morten L