tomcat startup script problems

Discuss installation of Scalix software

Moderators: ScalixSupport, admin

yakwakdo

tomcat startup script problems

Postby yakwakdo » Sat Jan 21, 2006 1:11 pm

I used the script found at http://www.scalix.com/community/viewtopic.php?t=529
When I try to run it I get, ": No such file or directory"

What is wrong?

ScalixSupport
Scalix
Scalix
Posts: 5503
Joined: Thu Mar 25, 2004 8:15 pm

Postby ScalixSupport » Sat Jan 21, 2006 3:26 pm

Hi. I hate to state the obvious, but did you modify this line in the script:

Code: Select all

###### !! PLEASE CHANGE THE FOLLOWING 3 LINES TO MATCH YOUR ENVIRONMENT !! ######
CATALINA_HOME="/home/jakarta-tomcat-5.0.19"
###### !! YOU SHOULD NOT NEED TO CHANGE ANYTHING BELOW HERE !! ######


to point to your installation of tomcat?

Thanks,
Rachel

yakwakdo

Postby yakwakdo » Sat Jan 21, 2006 3:45 pm

Yes. Here is what it says...

###### !! PLEASE CHANGE THE FOLLOWING 3 LINES TO MATCH YOUR ENVIRONMENT !! ######
CATALINA_HOME="/root/jakarta-tomcat-5.0.28"
###### !! YOU SHOULD NOT NEED TO CHANGE ANYTHING BELOW HERE !! ######


I am running SUSE 9.3. Everything else is working fine but tomcat won't start on bootup.

ScalixSupport
Scalix
Scalix
Posts: 5503
Joined: Thu Mar 25, 2004 8:15 pm

Postby ScalixSupport » Sun Jan 22, 2006 2:17 am

Hi. Let's back up one step. When you say "When I try to run it...", what are you typing to attempt to run it? Second, can you verify that your installation of tomcat is located in /root/jakarta-tomcat-5.0.28.

Thanks,
Rachel

yakwakdo

Postby yakwakdo » Sun Jan 22, 2006 10:32 pm

I found a post here that said to go to YAST, system service (runlevel) and run it from there. That's what I did. I installed tomcat into root. If you have a better place for it, please let me know. Is there a command that will "verify" the location of tomcat? I've added a startup script for ddclient and that one runs fine. I don't know what could be different about this one for tomcat. Here's the error again.
/etc/init.d/tomcat start returned 127 (unspecified error):
/bin/sh: : No such file or directory

I've tried running some of the lines inside of the script that I understand and they work just fine. Here's my script.

Code: Select all

#!/bin/sh
#
# chkconfig: 345 91 10
#
# description: \
# This is the init script for starting up the Jakarta Tomcat server.
#
# To install this script on a RedHat or SuSE Linux system, follow these steps:
#
#   (1) log in as root
#   (2) copy this script to /etc/init.d
#   (3) enter "chmod 755 /etc/init.d/scalix-tomcat"
#   (4) edit the script using vi or your favorite editor and ensure that
#       CATALINA_HOME points to the location of your Tomcat 4 or 5 (or later)
#       directory
#   (5) enter "chkconfig --add scalix-tomcat"
#
#       Tomcat will now be configured to start as a system service when the
#       machine boots.
#
#   (6) enter "/etc/init.d/scalix-tomcat start" to manually start Tomcat and
#       "/etc/init.d/scalix-tomcat stop" to manually stop Tomcat.
#


###### !! PLEASE CHANGE THE FOLLOWING 3 LINES TO MATCH YOUR ENVIRONMENT !! ######
CATALINA_HOME="/root/jakarta-tomcat-5.0.28"
###### !! YOU SHOULD NOT NEED TO CHANGE ANYTHING BELOW HERE !! ######

export CATALINA_HOME

# you do not need to change anything below here

# detect the distribution:
if [ -f /etc/redhat-release -o -f /etc/fedora-release ] ; then
    DISTRIBUTION="redhat"
elif [ -f /etc/SuSE-release ] ; then
    DISTRIBUTION="suse"
else
    echo "Error: unsupported distribution" >&2
    exit 1
fi

# Source function library.
[ "$DISTRIBUTION" = "redhat" ] && . /etc/init.d/functions
[ "$DISTRIBUTION" = "suse" ] && . /etc/rc.status


# test if network is up (redhat-only):
if [ "$DISTRIBUTION" = "redhat" ] ; then
    # Get config.
    . /etc/sysconfig/network

    # Check that networking is up.
    [ "${NETWORKING}" = "no" ] && exit 0
fi

startup=$CATALINA_HOME/bin/startup.sh
shutdown=$CATALINA_HOME/bin/shutdown.sh

# Where the Scalix server admin commands live (for Scalix server installed locally)
PATH=$PATH:/opt/scalix/bin; export PATH

# Functions

if [ "$DISTRIBUTION" = "redhat" ] ; then

start() {
        action $"Starting Tomcat service: "  $startup
        RETVAL=$?
}

stop() {
        action $"Stopping Tomcat service: " $shutdown
        RETVAL=$?
}

elif [ "$DISTRIBUTION" = "suse" ] ; then

start() {
        echo -n "Starting Tomcat service"
        $startup
        rc_status -v
}

stop() {
        echo -n "Stoppping Tomcat service"
        $shutdown
        rc_status -v
}

fi

restart() {
    stop
    start
}


[ "$DISTRIBUTION" = "suse" ] && rc_reset

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac

[ "$DISTRIBUTION" = "suse" ] && rc_exit
exit 0

ScalixSupport
Scalix
Scalix
Posts: 5503
Joined: Thu Mar 25, 2004 8:15 pm

Postby ScalixSupport » Sun Jan 22, 2006 10:44 pm

Okay, two things. First, are you saying you installed the tomcat script in /root? If so, it needs to be in /etc/init.d/. However, I believe you're actually referring to tomcat, the program, rather than tomcat the script that was installed in /root and that you did indeed install tomcat, the script in /etc/init.d.

So, did you, perhaps, edit the tomcat script on your PC and then copy it over to your Linux box? If so, that's the problem as DOS files are line terminated with <CRLF> and Unix files are line terminated with <NL> (i.e. LF's). Anyway, if that's the case, you need to do two things. First, run dos2unix again the file, then chmod it to 755:

cd /etc/init.d
dos2unix tomcat
chmod 755 tomcat

Now try starting tomcat by typing:

./tomcat start

and see what happens.

Thanks,
Rachel

yakwakdo

Postby yakwakdo » Sun Jan 22, 2006 11:07 pm

THANK YOU SO MUCH! It works now.

I hate asking for help but you have been very helpful.


Return to “Installation”



Who is online

Users browsing this forum: No registered users and 5 guests