{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... :(
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:
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 ;)
Re: {SERIOUS} To all Linux Fanatics out there I NEED HELP
Thanks ADAM, I appreciate your prompt reply... I'll try this right away.