Date: Fri, 22 Feb 2002 10:46:26 +1300 (NZDT) From: Jonathan Chen <jonc@wapsolutions.co.nz> To: FreeBSD-gnats-submit@freebsd.org Cc: freebsd-java@freebsd.org Subject: jakarta-tomcat-3.2.4 tomcatctl hangs, and startup fails Message-ID: <200202212146.g1LLkQv01993@wapsolutions.co.nz>
next in thread | raw e-mail | index | archive | help
>Submitter-Id: current-users
>Originator: Jonathan Chen
>Organization:
>Confidential: no
>Synopsis: jakarta-tomcat-3.2.4 tomcatctl hangs, and startup fails
>Severity: serious
>Priority: medium
>Category: ports
>Class: sw-bug
>Release: FreeBSD 4.5-STABLE i386
>Environment:
System: FreeBSD loki.wapsolutions.co.nz 4.5-STABLE FreeBSD 4.5-STABLE #0: Tue Feb 19 12:10:51 NZDT 2002 root@loki.wapsolutions.co.nz:/usr/src/sys/compile/LOKI i386
>Description:
1. /usr/local/bin/tomcatctl hangs when invoked.
2. /usr/local/etc/rc.d/020.jakarta-tomcat.sh fails on startup
>How-To-Repeat:
1. Invoke /usr/local/bin/tomcatctl
2. Invoke "/usr/local/etc/rc.d/020.jakarta-tomcat.sh start"
>Fix:
1. There's a missing & in tomcatctl start()
2. The supplied files/jakarta.sh shouldn't invoke su $USER when running
tomcatctl. The tomcatctl script already does this. Also the nested
invocation prevents the " tomcat" prompt from being generated on
startup. In my opinion jakarta.sh is superflous, and all that needs
to be done is to link 020.jakarta.sh to tomcatctl. Supplied patches
reflect this.
diff -ru /usr/ports/www/jakarta-tomcat/Makefile ./Makefile
--- /usr/ports/www/jakarta-tomcat/Makefile Fri Feb 22 09:33:15 2002
+++ ./Makefile Fri Feb 22 10:20:56 2002
@@ -83,7 +83,7 @@
| ${SED} "/%%APP_SHORTNAME%%/s//${APP_SHORTNAME}/" \
| ${SED} "/%%APP_HOME%%/s//${APP_HOME:S/\//\\\//g}/" \
| ${SED} "/%%LOG_DIR%%/s//${LOG_DIR:S/\//\\\//g}/" \
- | ${SED} "/%%STARTUP_SCRIPT_NAME%%/s//${PORTNAME}.sh/" \
+ | ${SED} "/%%RC_SCRIPT_NAME%%/s//${STARTUP_ORDER}.${PORTNAME}.sh/" \
| ${SED} "/%%JAVA_HOME%%/s//${JAVA_HOME:S/\//\\\//g}/" \
| ${SED} "/%%USER_NAME%%/s//${USER_NAME}/" \
| ${SED} "/%%STDOUT_LOG%%/s//${STDOUT_LOG:S/\//\\\//g}/" \
@@ -93,8 +93,7 @@
${CHMOD} 6554 ${CTL_SCRIPT}
@# Install the startup script
- ${CP} ${FILESDIR}/${PORTNAME}.sh ${STARTUP_SCRIPT}
- ${CHMOD} 0554 ${STARTUP_SCRIPT}
+ ${LN} -sf ${CTL_SCRIPT} ${STARTUP_SCRIPT}
@# Create the directories that the application will create at the
@# first run
diff -ru /usr/ports/www/jakarta-tomcat/files/jakarta-tomcat.sh ./files/jakarta-tomcat.sh
--- /usr/ports/www/jakarta-tomcat/files/jakarta-tomcat.sh Thu Feb 21 21:59:45 2002
+++ ./files/jakarta-tomcat.sh Fri Feb 22 10:12:30 2002
@@ -1,24 +1,21 @@
#!/bin/sh
# Set some variables
-USER_NAME=%%USER_NAME%%
MYSELF=`basename $0`
CONTROL_SCRIPT=%%CONTROL_SCRIPT%%
case "$1" in
start)
- su - ${USER_NAME} -c "%%CONTROL_SCRIPT%% start" > /dev/null ; echo -n
+ %%CONTROL_SCRIPT%% start
;;
stop)
- su - ${USER_NAME} -c "%%CONTROL_SCRIPT%% stop"
+ %%CONTROL_SCRIPT%% stop
;;
restart)
- su - ${USER_NAME} -c "%%CONTROL_SCRIPT%% restart"
+ %%CONTROL_SCRIPT%% restart
;;
*)
- echo ""
echo "Usage: ${MYSELF} { start | stop | restart }"
- echo ""
exit 64
;;
esac
diff -ru /usr/ports/www/jakarta-tomcat/files/tomcatctl ./files/tomcatctl
--- /usr/ports/www/jakarta-tomcat/files/tomcatctl Fri Feb 22 09:33:15 2002
+++ ./files/tomcatctl Fri Feb 22 10:04:59 2002
@@ -68,7 +68,7 @@
if [ "${AS_RC_SCRIPT}" = "yes" ]; then
echo -n " %%APP_SHORTNAME%%"
fi
- su - ${USER_NAME} -c "(cd ${APP_HOME} && ${JAVA_CMD} -cp ${CLASSPATH} -Dtomcat.home=${APP_HOME} org.apache.tomcat.startup.Tomcat) >> ${STDOUT_LOG} 2>> ${STDERR_LOG}"
+ su - ${USER_NAME} -c "(cd ${APP_HOME} && ${JAVA_CMD} -cp ${CLASSPATH} -Dtomcat.home=${APP_HOME} org.apache.tomcat.startup.Tomcat) >> ${STDOUT_LOG} 2>> ${STDERR_LOG}" &
}
# Function that stops the application
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202212146.g1LLkQv01993>
