From owner-freebsd-java@FreeBSD.ORG Thu Oct 20 17:53:30 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F07CB16A41F for ; Thu, 20 Oct 2005 17:53:29 +0000 (GMT) (envelope-from tomasv@megalogika.lt) Received: from megalogika.stp.lt (megalogika.stp.lt [193.219.52.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4389B43D6A for ; Thu, 20 Oct 2005 17:53:23 +0000 (GMT) (envelope-from tomasv@megalogika.lt) Received: from pilvas.lan (pilvas.lan [192.169.1.78]) by megalogika.stp.lt (Postfix) with ESMTP id 67262428 for ; Thu, 20 Oct 2005 20:53:18 +0300 (EEST) Received: by pilvas.lan (Postfix, from userid 1001) id 3397D40D5; Thu, 20 Oct 2005 20:53:28 +0300 (EEST) Date: Thu, 20 Oct 2005 20:53:28 +0300 From: Tomas Verbaitis To: freebsd-java@freebsd.org Message-ID: <20051020175328.GA7205@megalogika.lt> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline X-URL: http://blog.hardcore.lt/ve/ X-PGP-Key: http://hardcore.lt/ve/pubkey.txt X-PGP-Key-Fingerprint: E8FB 7C13 99D9 ABDE 0494 B9F6 4D9C F010 881D 3A26 X-nic-hdl: TV13-LT User-Agent: Mutt/1.5.9i Subject: Tomcat 5.5 startup and shutdown.. again X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: tomasv@megalogika.lt List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2005 17:53:30 -0000 --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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=3D">> ${jakarta_tomcat%%TOMCAT_VERSION%%_stdout_log} \ 2>> ${jakarta_tomcat%%TOMCAT_VERSION%%_stderr_log} " =20 -procname=3D"java" +procname=3D"%%JAVA_HOME%%/bin/java" +pidfile=3D"/var/run/tomcat%%TOMCAT_VERSION%%.pid" required_files=3D"${jakarta_tomcat%%TOMCAT_VERSION%%_catalina_home}/conf/s= erver.xml" =20 command=3D"/usr/sbin/daemon" -flags=3D"${command} ${java_command} start ${jakarta_tomcat%%TOMCAT_VERSION= %%_flags} ${log_args}" - -stop_cmd=3D"jakarta_tomcat%%TOMCAT_VERSION%%_stop" - -jakarta_tomcat%%TOMCAT_VERSION%%_stop() { - echo "Stopping ${name}." - ${java_command} stop - wait_for_pids -} +flags=3D"-p ${pidfile} ${java_command} start ${jakarta_tomcat%%TOMCAT_VERS= ION%%_flags} ${log_args}" =20 run_rc_command "$1" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Makefile.orig Thu Sep 29 18:08:23 2005 +++ Makefile Thu Oct 20 20:35:40 2005 @@ -64,7 +64,8 @@ TOMCAT_HOME=3D${APP_HOME} \ USER=3D${TOMCAT_USER} \ STDOUT_LOG=3D${STDOUT_LOG} \ - STDERR_LOG=3D${STDERR_LOG} + STDERR_LOG=3D${STDERR_LOG} \ + JAVA_HOME=3D${JAVA_HOME} =20 REPLACE_FILES+=3D ${PKGDIR}/pkg-install \ ${PKGDIR}/pkg-deinstall =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 :) --=20 Tomas "Verbaitis" Verbaitis ** http://megalogika.lt * =C5=A1ita gudri be=C5=BEd=C5=BEion=C4=97 moka dirbti su kompiuteriu * --OXfL5xGRrasGEqWY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDV9mXTZzwEIgdOiYRAgMyAJ4lHEMhusH4mCSIEv6svnqu1BR/CwCfQu6w Y5bcslY1Su9YGkfYGhbVoXo= =CBFH -----END PGP SIGNATURE----- --OXfL5xGRrasGEqWY--