Results 1 to 3 of 3

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

  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.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

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

    You should start the script use in /bin/sh rather than bash. To force a certain interpreter put this at the top of your script:
    Code:
    #!/bin/sh
    Then make the script executable using chmod +x tomcat.sh

    Also you need to make sure you have MySql installed and that the networking and functions scripts you are trying to import exist on the client system.

    P.s: I put it in the General Developer forum
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

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

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

    Thanks ADAM, I appreciate your prompt reply... I'll try this right away.

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