Econify
asked on
Debian Linux : how to autostart tomcat on bootup
hello experts
i have manually installed tomcat server 5 at /usr/local/tomcat
on a ubuntu machine and another debinac machine
i want to start tomcat server automatically on reboot of the machine
i googled but the help is for tomcat 4 versions where TOMCAT_HOME variable is used
now in my server CATALINA_HOME is used
so i'm confused
pls provide the script for tomcat 5 server
pls guide
thanks
jags
i have manually installed tomcat server 5 at /usr/local/tomcat
on a ubuntu machine and another debinac machine
i want to start tomcat server automatically on reboot of the machine
i googled but the help is for tomcat 4 versions where TOMCAT_HOME variable is used
now in my server CATALINA_HOME is used
so i'm confused
pls provide the script for tomcat 5 server
pls guide
thanks
jags
ASKER
hi hoff man
no idea bat what u r saying
rc-script????
copy this script to the proper rc-directory (/etc/init.d/ usually) then enable the startup with the proper tools (IIRC it is sysconfig on RH)
can u pls elaborate on this
no idea bat what u r saying
rc-script????
copy this script to the proper rc-directory (/etc/init.d/ usually) then enable the startup with the proper tools (IIRC it is sysconfig on RH)
can u pls elaborate on this
rc-scripts are scripts used by Unix/linux while booting. Each script must have at least 2 modes: start and stop.
These "modes" are passed as parameter to the script.
If tomcat does not come with such a script, use the sample one you find in /etc/init.d and adapt it for tomcat, giv it a unique name and enable it with the proper RH tool (sysconfig).
These "modes" are passed as parameter to the script.
If tomcat does not come with such a script, use the sample one you find in /etc/init.d and adapt it for tomcat, giv it a unique name and enable it with the proper RH tool (sysconfig).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
update:
you might also do a chown tomcat5 -R <CATALINA_HOME> to make sure tomcat can read everything
you might also do a chown tomcat5 -R <CATALINA_HOME> to make sure tomcat can read everything
su in an rc-script, is tomcat that stupid?
also, if su is really necessary, I'd use it without - 'cause the shell profiles may contain dangerous things (like stty, etc.)
also, if su is really necessary, I'd use it without - 'cause the shell profiles may contain dangerous things (like stty, etc.)
su in an rc-script, is tomcat that stupid?
euhm, java doesn't know how todrop privelegdes and you don't want tomcat to run as root.
the '-' allows me to specify the custom path variable (exclude binaries/specify alternative JVM/....) and if someone is able to add content to the .profile you have bigger problems to worry about.
euhm, java doesn't know how todrop privelegdes and you don't want tomcat to run as root.
the '-' allows me to specify the custom path variable (exclude binaries/specify alternative JVM/....) and if someone is able to add content to the .profile you have bigger problems to worry about.
ASKER
hi verborghs
u script is absolutely amazing
hey other guys this is way to answer(please guys be a little elaborate)
thanks a ton for that
can u explain me what is
update-rc.d tomcat5 defaults 90
and will this script shutdown the server properly in case there is a halt or reboot
thanks again
u script is absolutely amazing
hey other guys this is way to answer(please guys be a little elaborate)
thanks a ton for that
can u explain me what is
update-rc.d tomcat5 defaults 90
and will this script shutdown the server properly in case there is a halt or reboot
thanks again
> .. java doesn't know how todrop privelegdes ..
LOL, another reason to switch back to reliable shell scripting ;-)
> .. you have bigger problems to worry about.
agreed, my intent was to point to these problems.
LOL, another reason to switch back to reliable shell scripting ;-)
> .. you have bigger problems to worry about.
agreed, my intent was to point to these problems.
update-rc.d makes links from the needed rcX.d folders. the folders control what gets starten in which runlevel. runlevels are like safe-boot/networking/no-ne tworking/n ormal choice you have when booting windows only better ;)
because of the names of the links that get created your linux system will call the script with start or stop as an argument, so yes, your tomcat will be shutdown as it shoul
because of the names of the links that get created your linux system will call the script with start or stop as an argument, so yes, your tomcat will be shutdown as it shoul
ASKER
hi verborghs
there's a small error in ur script
su - $TOMCAT_USER -s /bin/bash -c "$DAEMON_CONTROL run"
shud be
su - $TOMCAT_USER -s /bin/bash -c "$DAEMON_CONTROL" run
other wise u get the error not a directory
and hey i just did a shutdown -r now
and the tomcat did not start automaticaly on bootup
there's a small error in ur script
su - $TOMCAT_USER -s /bin/bash -c "$DAEMON_CONTROL run"
shud be
su - $TOMCAT_USER -s /bin/bash -c "$DAEMON_CONTROL" run
other wise u get the error not a directory
and hey i just did a shutdown -r now
and the tomcat did not start automaticaly on bootup
ASKER
i checked whether the link is there
and its there
debinac:~# update-rc.d tomcatstartnew defaults 90
System startup links for /etc/init.d/tomcatstartnew already exist.
debinac:~#
whats 90 for ??
and its there
debinac:~# update-rc.d tomcatstartnew defaults 90
System startup links for /etc/init.d/tomcatstartnew
debinac:~#
whats 90 for ??
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks dudes
now it works
now it works
copy this script to the proper rc-directory (/etc/init.d/ usually) then enable the startup with the proper tools (IIRC it is sysconfig on RH)