Date: Thu, 20 Oct 2005 20:53:28 +0300 From: Tomas Verbaitis <tomasv@megalogika.lt> To: freebsd-java@freebsd.org Subject: Tomcat 5.5 startup and shutdown.. again Message-ID: <20051020175328.GA7205@megalogika.lt>
index | next in thread | raw e-mail
[-- Attachment #1 --]
ahoj!
I looked through the new Tomcat startup script and noticed it does not
really interact with tomcat55ctl program:
* rcNG script uses org.apache.catalina.startup.Bootstrap both for
starting and stopping; therefore it does not honor
/var/run/tomcat55.pid
* tomcat55ctl uses org.apache.catalina.startup.Bootstrap to start
Tomcat, to stop it just sends a SIGTERM to the running process.
Having both tools available can create some mess: you can launch at
least two copies of Tomcat using both tools, you can not stop Tomcat
launched with rcNG script using tomcat55ctl and vice versa.
Then i checked org.apache.catalina.startup.Catalina and found that it
doesn't do anything spectacular at shutdown: it just calls stop(), which
is also called when CatalinaShutdownHook() is run. Hence, i assume, it's
equally safe to stop Tomcat by sending it a SIGTERM.
This would also simplify rcNG script, as it could use default
/etc/rc.subr functions.
Proposed patch follows:
==================================================================================================
--- tomcat.sh.in.orig Wed Sep 14 15:30:23 2005
+++ tomcat.sh.in Thu Oct 20 20:18:32 2005
@@ -98,18 +98,11 @@
log_args=">> ${jakarta_tomcat%%TOMCAT_VERSION%%_stdout_log} \
2>> ${jakarta_tomcat%%TOMCAT_VERSION%%_stderr_log} "
-procname="java"
+procname="%%JAVA_HOME%%/bin/java"
+pidfile="/var/run/tomcat%%TOMCAT_VERSION%%.pid"
required_files="${jakarta_tomcat%%TOMCAT_VERSION%%_catalina_home}/conf/server.xml"
command="/usr/sbin/daemon"
-flags="${command} ${java_command} start ${jakarta_tomcat%%TOMCAT_VERSION%%_flags} ${log_args}"
-
-stop_cmd="jakarta_tomcat%%TOMCAT_VERSION%%_stop"
-
-jakarta_tomcat%%TOMCAT_VERSION%%_stop() {
- echo "Stopping ${name}."
- ${java_command} stop
- wait_for_pids
-}
+flags="-p ${pidfile} ${java_command} start ${jakarta_tomcat%%TOMCAT_VERSION%%_flags} ${log_args}"
run_rc_command "$1"
==================================================================================================
--- Makefile.orig Thu Sep 29 18:08:23 2005
+++ Makefile Thu Oct 20 20:35:40 2005
@@ -64,7 +64,8 @@
TOMCAT_HOME=${APP_HOME} \
USER=${TOMCAT_USER} \
STDOUT_LOG=${STDOUT_LOG} \
- STDERR_LOG=${STDERR_LOG}
+ STDERR_LOG=${STDERR_LOG} \
+ JAVA_HOME=${JAVA_HOME}
REPLACE_FILES+= ${PKGDIR}/pkg-install \
${PKGDIR}/pkg-deinstall
==================================================================================================
If port maintainers think it makes sense, i can file a PR, so this
proposal does not get forgotten -- Herve promised not to touch tomcat55
until other Tomcat ports are fixed, so it can take time :)
--
Tomas "Verbaitis" Verbaitis ** http://megalogika.lt
* šita gudri beždžionė moka dirbti su kompiuteriu *
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)
iD8DBQFDV9mXTZzwEIgdOiYRAgMyAJ4lHEMhusH4mCSIEv6svnqu1BR/CwCfQu6w
Y5bcslY1Su9YGkfYGhbVoXo=
=CBFH
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051020175328.GA7205>
