---------------------------- /etc/init.d/tomcat ------------------------
#!/bin/bash
#
# tomcat
#
# chkconfig:
# description: Start up the Tomcat servlet engine.
# Source function library.
. /etc/init.d/functions
RETVAL=$?
CATALINA_HOME="/usr/apps/apache/tomcat/jakarta-tomcat-4.0.4"
case "$1" in
start)
if [ -f $CATALINA_HOME/bin/startup.sh ];
then
echo $"Starting Tomcat"
/bin/su tomcat $CATALINA_HOME/bin/startup.sh
fi
;;
stop)
if [ -f $CATALINA_HOME/bin/shutdown.sh ];
then
echo $"Stopping Tomcat"
/bin/su tomcat $CATALINA_HOME/bin/shutdown.sh
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit $RETVAL
----------------------- end of /etc/init.d/tomcat ----------------------
---------------------------- /etc/init.d/apache ------------------------
#!/bin/bash
#
# apache
#
# chkconfig:
# description: Start up the Apache web server.
# Source function library.
. /etc/init.d/functions
RETVAL=$?
APACHE_HOME="/usr/apps/apache/apache"
case "$1" in
start)
if [ -f $APACHE_HOME/bin/apachectl ]; then
echo $"Starting Apache"
$APACHE_HOME/bin/apachectl start
fi
;;
stop)
if [ -f $APACHE_HOME/bin/apachectl ]; then
echo $"Stopping Apache"
$APACHE_HOME/bin/apachectl stop
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit $RETVAL
----------------------- end of /etc/init.d/apache ----------------------
Ricordatevi di creare i link agli script (per lo start e lo stop o kill) nel runlevel giusto.
Ad esempio per il run level 5:
cd /etc/rc5.d
sudo ln -s ../init.d/tomcat S71tomcat
sudo ln -s ../init.d/apache S72apache
Nessun commento:
Posta un commento