On Sun, Dec 22, 2002 at 01:02:14PM +0900 or thereabouts, shawn wrote:
> I have the following in /etc/profile.d which works fine but I would like
> to move it to /etc/rc.d/init.d and then link it to the correct run
> level.
> <snip> 
> Any tips? Pointers?
> 

I'm not sure why your script isn't working.  Offhand it looks okay to me.  I would 
recommend, however, creating your script in /etc/init.d and adding something like the 
following to the top of the script:

#!/bin/bash
# tomcat        This is the init script for starting up the Jakarta Tomcat
#               server
#
# chkconfig: 345 90 10 
# description: Starts and stops the Tomcat daemon.
#
# This says that the script should be started in 
# levels 3, 4, and 5, that its start priority should be
# 90, and  that  its  stop priority should be 10.

This will allow you to use

$ chkconfig -add script_name

to create the links in rc[0-6].d directories.  


> <snip>
> instead of putting the scripts in init.d so I can create a user with no
> permissions and run it via suinstead of root
> 

I created a "tomcat" user to run tomcat and used "su tomcat -c $startup" to drop root 
privileges when the script is run from init.d.

I recently posted a script to start and stop tomcat:

http://marc.theaimsgroup.com/?l=redhat-list&m=104009409120315&w=2

You could easily adapt this to mysql, I think.  


I would suggest using separate scripts for mysql and tomcat.  This will allow you to 
start mysql before tomcat (use lower priority numbers in your init.d script) so that 
the database is already up before you start your webapps.  

You can also now use the "service" tool to administer tomcat and mysql, restarting 
them independently, if needed.

e.g.
$ service tomcat restart


HTH

-- 
Andrew Pasquale 



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to