RC tomcat startup script starter ved manuel eksekvering ikke boot
OS: Debian SargeTomcat: Tomcat 5
Script i init.d:
#!/bin/sh
#
# chkconfig: 345 91 35
# description: Starts and TomCat servlet server
# used to provide servlets servlet service for apache.
# See how we were called.
echo "Dette er start paa tomcat scriptet"
TOMCAT_HOME=/usr/local/Java/TomCat
case "$1" in
start)
for user in `ls $TOMCAT_HOME | awk '{ print $1; }'` ; do
su ${user} -c "/usr/local/Scripts/tomcat.sh start"
done
;;
stop)
for user in `ls $TOMCAT_HOME | awk '{ print $1; }'` ; do
su ${user} -c "/usr/local/Scripts/tomcat.sh stop"
done
;;
restart)
echo -n "Restarting TomCat server"
echo ""
$0 stop
sleep 5
$0 start
;;
*)
echo "Usage: tomcat.sh {start|stop|restart}"
exit 1
esac
Script i /usr/local/Scripts:
!/bin/bash
#
# chkconfig: 345 91 35
# description: Starts and TomCat servlet server
# used to provide servlets servlet service for apache.
JAVA_OPTS="-Xincgc -Xms128m -Xmx1024m"
# See how we were called.
TOMCAT_HOME=/usr/local/Java/TomCat
case "$1" in
start)
$0 kill
cd /home/${USER}/Source/WEB-INF/classes
/usr/local/Scripts/setCLASSPATH.sh "${TOMCAT_HOME}/${USER}/bin/catalina.sh start" > ${TOMCAT_HOME}/${USER}/logs/console.log 2>&1
;;
stop)
/usr/local/Scripts/setCLASSPATH.sh "${TOMCAT_HOME}/${USER}/bin/catalina.sh stop" > /dev/null
;;
kill)
kill -9 $(ps U $USER | grep "TomCat" | grep -v "tail" | awk '{print $1}') 2>&1 |cat> /dev/null
;;
restart)
echo -n "Restarting Tomcat server"
$0 stop
sleep 5
$0 start
echo ""
;;
*)
echo "Usage: tomcat.sh {start|stop|restart}"
exit 1
esac
RC opdateringer kørt efterfølgende:
update-rc.d /etc/init.d/tomcat start 97 2 3 4 5 . stop 97 0 1 6 .
Generel info:
Jeg har en tomcat liggende pr. bruger på systemet, alle navngivet efter brugernavnet og ligger i /usr/local/Java/TomCat/*
Eksekverer jeg ovenstående script /etc/init.d/tomcat manuelt, virker alt fint. Men udfra de ovenstående angivne RC updates starter tomcat ikke op automatisk.
Jeg har en fornemmelse af at der på en eller anden måde ikke kan su'es i systemet på tidspunktet for rc scriptes startup.
Input søges =)