You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Bob Hartung <rw...@mchsi.com> on 2006/02/22 23:35:05 UTC

Tomcat5.5 init script on FC4 revisited

Hi all,
   I have modified a file from Warren Pace.  After running, I can ps ax 
| grep jsvc and have two pids but trying to http://localhost:8080 gives 
a refusal.  I have checked the log files and there is no entry.  If I 
try to start with the startup.sh file everygthing works including 
running the shell script as either root or user tomcat.  I have 
reproduced portions of the file below.  This file is written for SuSE 
and I am running FC4.  I do not find checkproc on the fedora site.

   Any and all suggestions appreciated.

---------------- begin file -----------------------
#!/bin/sh
# Copyright (c) 2005 Warren Pace, Charleston, SC, USA
# init.d script for Apache-Tomcat ver 5.5.12
# For Open SuSE Linux ver 10.0
# Free for all - Use at your own risk
# Author:  Warren Pace <wa...@bellsouth.net>
#
# /etc/init.d/tomcat5
#


JAVA_HOME=/usr/local/java
CATALINA_HOME=/usr/local/tomcat5
DAEMON_HOME=/usr/local/tomcat5
TOMCAT_USER=tomcat

TMP_DIR=/var/tmp
PID_FILE=/var/run/jsvc.pid
CATALINA_BASE=/usr/local/tomcat5
CATALINA_TMPDIR=/usr/local/tomcat5/temp
CATALINA_OPTS="-Djava.endorsed.dirs=$CATALINA_HOME/common/endorsed"
CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar

JSVC_BIN=$DAEMON_HOME/bin/jsvc

#. /etc/rc.status
#rc_reset

if [ ! -x ${JSVC_BIN} ]; then
	echo -n >$2 "Cannot Run Tomcat as a jsvc daemon, ${JSVC_BIN} is not
installed. "
#	rc_status -s
	exit 5
fi

case "$1" in
   	start)
     	#
	# Start Tomcat
     	#
     	echo -n "Starting Tomcat 5.5.12 Servlet Engine "
#       checkproc on installed on FC4 (?)
#    	checkproc -p ${PID_FILE} ${JSVC_BIN}
#    	case $? in
#		0) echo -n "- Warning: daemon already running. " ;;
#		1) echo -n "- Warning: ${PID_FILE} exists. " ;;
#    	esac
     	$DAEMON_HOME/bin/jsvc \
     	-user $TOMCAT_USER \
     	-home $JAVA_HOME \
     	-Dcatalina.home=$CATALINA_HOME \
     	-Dcatalina.base=$CATALINA_BASE \
     	-Dcatalina.tmpdir=$CATALINA_TMPDIR \
     	-Djava.io.tmpdir=$TMP_DIR \
     	-wait 10 \
     	-pidfile $PID_FILE \
     	-outfile $CATALINA_HOME/logs/catalina.out \
     	-errfile '&1' \
     	$CATALINA_OPTS \
	-Xms64M -Xmx128M \
     	-cp $CLASSPATH \
     	org.apache.catalina.startup.Bootstrap \
     	#-verbose \
     	#-debug \
     	chown -R -H --dereference tomcat:tomcat $CATALINA_HOME/*
     	chown -R -H --dereference tomcat:tomcat $CATALINA_BASE/*
#    	rc_status -v
     	;;

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org