starting a process on reboot

Nigel Wade nmw at ion.le.ac.uk
Thu Jan 12 17:08:47 UTC 2006


Dana Holland wrote:
> I'm sure I'm not using the proper search times, but I just can't seem to 
> find an answer to this on Google.
> 
> We're trying to set our server up to start Tomcat automatically on 
> reboot.  I have the proper scripts in init.d and rc.d, and it does start 
> the server, but because it's not being started as the tomcat user, it's 
> not functional.  How can I make it start as the tomcat user?
> 
> 

This is what I do in mine (for Tomcat 4):

    if [ -x /etc/rc.d/init.d/functions ]; then
        daemon --user $TOMCAT_USER $TOMCAT_SCRIPT start
    else
        su - $TOMCAT_USER -c "$TOMCAT_SCRIPT start"
    fi

where:
TOMCAT_SCRIPT=${CATALINA_HOME}/bin/dtomcat4
TOMCAT_USER="tomcat4"

-- 
Nigel Wade, System Administrator, Space Plasma Physics Group,
             University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw at ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555




More information about the redhat-list mailing list