Vai alla freccia - Homepage - BlogRoom - Mappa Visualizza Messaggi.
|
Nick: Ery Oggetto: Help Linux Data: 31/8/2007 11.54.4 Visite: 517
PEr chiunque di oi abbia una versione di linux che non sia la suse puo' controllare se il seguente script funziona, o meglio che eseguendo uno di questi due comandi sh tomcat.sh start opp source tomcat.sh start non gli esca il seguente errore : command not found : command not found : command not found 'ash: tomcat.sh: line 16: syntax error near unexpected token `in 'ash: tomcat.sh: line 16: `case "$1" in Lo script è il seguente #!/bin/bash # # Startup script for Tomcat # # chkconfig: 345 85 15 - [the runlevel] [start order/priority] [stop/shutdown order] - - This statement tells the chkconfig command how to add or delete this process to the boot process # description: Tomcat Apache 4.1.36 # processname: tomcat # pidfile: /etc/apache-tomcat-4.1.36/bin/tomcat.pid # Source function library. This creates the operating environment for the process to be started #. /etc/rc.d/init.d/tomcat.sh TOMCAT_USER=root RETVAL=0 case "$1" in start) # Start Tomcat in normal mode SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep 8080|wc -l` if [ $SHUTDOWN_PORT -ne 0 ]; then echo "Tomcat already started" else echo "Starting tomcat..." chown -R $TOMCAT_USER:$TOMCAT_USER /etc/apache-tomcat-4.1.36/* #chown -R $TOMCAT_USER:$TOMCAT_USER /home/tomcat/* su -l $TOMCAT_USER -c '/etc/apache-tomcat-4.1.36/bin/startup.sh' SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep 8080|wc -l` while [ $SHUTDOWN_PORT -eq 0 ]; do sleep 1 SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep 8080|wc -l` done RETVAL=$? echo "Tomcat started in normal mode" [ $RETVAL=0 ] && touch /var/lock/subsys/tomcat fi ;; debug) # Start Tomcat in debug mode SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep 8080|wc -l` if [ $SHUTDOWN_PORT -ne 0 ]; then echo "Tomcat already started" else echo "Starting tomcat in debug mode..." chown -R $TOMCAT_USER:$TOMCAT_USER /etc/apache-tomcat-4.1.36/* #chown -R $TOMCAT_USER:$TOMCAT_USER /home/tomcat/* su -l $TOMCAT_USER -c '/etc/apache-tomcat-4.1.36/bin/catalina.sh jpda start' SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep 8080|wc -l` while [ $SHUTDOWN_PORT -eq 0 ]; do sleep 1 SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep 8080|wc -l` done RETVAL=$? echo "Tomcat started in debug mode" [ $RETVAL=0 ] && touch /var/lock/subsys/tomcat fi ;; stop) SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep 8080|wc -l` if [ $SHUTDOWN_PORT -eq 0 ]; then echo "Tomcat already stopped" else echo "Stopping tomcat..." su -l $TOMCAT_USER -c '/etc/apache-tomcat-4.1.36/bin/shutdown.sh' SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep 8080|wc -l` while [ $SHUTDOWN_PORT -ne 0 ]; do sleep 1 SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep 8080|wc -l` done RETVAL=$? echo "Tomcat stopped" [ $RETVAL=0 ] && rm -f /var/lock/subsys/tomcat /etc/apache-tomcat-4.1.36/bin/tomcat.pid fi ;; restart) stop start ;; redebug) stop debug ;; status) SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep 8080|wc -l` if [ $SHUTDOWN_PORT -eq 0 ]; then echo "Tomcat stopped" else MODE="normal" JPDA_PORT=`netstat -vatn|grep LISTEN|grep 8000|wc -l` if [ $JPDA_PORT -ne 0 ]; then MODE="debug" fi echo "Tomcat running in $MODE mode" fi ;; *) echo "Usage: $0 {start|debug|stop|restart|redebug|status}" exit 1 esac exit $RETVAL
|
Rispondi al Messaggio | Indietro | Indice topic | Quota Testo | Vai su| Segnala ad un amico|Successivo

|