Results 1 to 3 of 3

Thread: {SERIOUS} To all Linux Fanatics out there I NEED HELP

Threaded View

  1. #1

    Thread Starter
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Exclamation {SERIOUS} To all Linux Fanatics out there I NEED HELP

    Code:
    #	This is the init script for starting up the 
    #		Jakarta Tomcat server
    #
    # chkconfig: 345 91 10 
    # description: Starts and stops the Project Yagi daemon.
    #
    
    # Source function library.
    . /etc/rc.d/init.d/functions
    
    # Get config.
    . /etc/sysconfig/network
    
    # Check that networking is up.
    [ "${NETWORKING}" = "no" ] && exit 0
    
    tomcat=/usr/tomcat
    
    SWEBLIBPATH=/usr/local/sweb
    SWEB_BAT=$SWEBLIBPATH/Tomcat/runtomcat.sh
      
    startup=$SWEB_BAT 
    
    shutdown=$tomcat/bin/shutdown.sh
    
    start(){
    
    	echo -n $"Starting Project Yagi service sweb: " 
    
          if [ -f /usr/X11R6/bin/Xvfb ]; then
    	echo "***Starting up the Virtual Frame Buffer on Screen 1***"
          /usr/X11R6/bin/Xvfb :1 -screen 0 1x1x8 > /dev/null 2>&1 &
    	/usr/X11R6/bin/Xvfb :1 -screen 0 1152x900x8 &
          fi 
          export DISPLAY=:1.0 
    
    	#start mysql version 4.0.18
    	cd /etc/init.d
    	bash mysqld stop
    	/usr/local/mysql/bin/mysqld_safe --user=mysql &
    	RETVAL=$?  &
    	echo 
    }
    
    stop(){ 
    	action $"Stopping Tomcat service: " > /dev/null 2>&1	
    	RETVAL=$?
    	echo
    }
    
    restart(){
        stop
        start
    }
    
    status(){
    numproc=`ps -ef | grep catalina | grep -v "grep catalina" | wc -l`
    if [ $numproc -gt 0 ]; then
    echo "Tomcat is running..."
    else
    echo "Tomcat is stopped..."
    fi
    }
    
    # See how we were called.
    case "$1" in
      start)
    	start
    	;;
      stop)
    	stop
    	;;
      status)
            # This doesn't work ;)
    	status
    	;;
      restart)
    	restart
    	;;
      *)
    	echo $"Usage: $0 {start|stop|status|restart}"
    	exit 1
    esac
    
    exit 0
    The above code is for linux and on the office's linux box this script runs fine and on the box of the client this script won't run... here is the error code

    Code:
    [user@RW user]$ bash tomcat.sh start
    : command not found
    : command not found 
    : command not found 
    : command not found 
    : command not found 
    : command not found 
    : command not found 
    : command not found 
    : command not found 
    'omcat.sh: line 26: syntax error near unexpected token `{
    'omcat.sh: line 26: `start(){
    [user@RW user]$
    wot could possibly be wrong with this... i'm sorry to post this here. but I just don't know what category this question is.

    *edit
    the above code works in fedora core while an error will occur in the REDHAT 9...
    Last edited by oceanebelle; Jun 14th, 2005 at 06:43 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width