From owner-freebsd-questions@FreeBSD.ORG Fri Jun 10 15:42:04 2005 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 19D5016A41C for ; Fri, 10 Jun 2005 15:42:04 +0000 (GMT) (envelope-from matthew@thebunker.net) Received: from male.aldigital.co.uk (male.thebunker.net [213.129.64.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9ECA043D4C for ; Fri, 10 Jun 2005 15:42:03 +0000 (GMT) (envelope-from matthew@thebunker.net) Received: from lack-of-gravitas.thebunker.net (gateway.ash.thebunker.net [213.129.64.4]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by male.aldigital.co.uk (Postfix) with ESMTP id 8A2F597612; Fri, 10 Jun 2005 16:42:02 +0100 (BST) Received: from lack-of-gravitas.thebunker.net (localhost [127.0.0.1]) by lack-of-gravitas.thebunker.net (8.13.3/8.13.3) with ESMTP id j5AFg23L054875; Fri, 10 Jun 2005 16:42:02 +0100 (BST) (envelope-from matthew@lack-of-gravitas.thebunker.net) Received: (from matthew@localhost) by lack-of-gravitas.thebunker.net (8.13.3/8.13.3/Submit) id j5AFg1XG054874; Fri, 10 Jun 2005 16:42:01 +0100 (BST) (envelope-from matthew) Date: Fri, 10 Jun 2005 16:42:01 +0100 From: Matthew Seaman To: Ilia Chipitsine Message-ID: <20050610154201.GB15391@lack-of-gravitas.thebunker.net> Mail-Followup-To: Matthew Seaman , Ilia Chipitsine , questions@freebsd.org References: <20050610184040.P38348@office.paramon.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aVD9QWMuhilNxW9f" Content-Disposition: inline In-Reply-To: <20050610184040.P38348@office.paramon.ru> User-Agent: Mutt/1.5.9i Cc: questions@freebsd.org Subject: Re: passing custom parameters to java when starting tomcat ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2005 15:42:04 -0000 --aVD9QWMuhilNxW9f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 10, 2005 at 06:42:12PM +0600, Ilia Chipitsine wrote: > I tried to investigate supplied tomcat50ctl script, but I couldn't find > where I add "-Djava.awt.headless=3Dtrue" to java machine command line=20 > options. Can anyone help me ? tomcat50ctl isn't actually a script. It's a setuid binary. Which is good in the sense that it allows you to control tomcat without needing root access to a box, but inflexible when it comes to modifying the Java command line. When I ran into the problem you're seeing I ended up modifying the Makefile in the www/jakarta-tomcat5 port so that my custom arguments got compiled into the tomcat50ctl program. This diff probably isn't exactly what you need, but it should show you the idea: caernarvon:...ports/www/jakarta-tomcat5:% diff -u Makefile.orig Makefile=20 --- Makefile.orig Thu Mar 3 13:22:56 2005 +++ Makefile Thu Mar 3 14:05:51 2005 @@ -136,7 +136,7 @@ =20 @${ECHO_MSG} -n ">> Compiling and installing control program..." @${SED} \ - -e "/%%JAVA_ARGS%%/s//\"-Dcatalina.home=3D${APP_HOME:S/\//\\\//g}\"= ,/g" \ + -e "/%%JAVA_ARGS%%/s//\"-server\", \"-Xmx1500m\", \"-Djava.awt.head= less=3Dtrue\", \"-Dcatalina.home=3D${APP_HOME:S/\//\\\//g}\",/g" \ -e "/%%JAR_ARGS%%/s//\"start\",/g" \ ${WRKDIR}/daemonctl.c > ${WRKDIR}/daemonctl_.c @cd ${WRKDIR} && ${CC} -ansi -o ${CONTROL_SCRIPT_NAME} daemonctl_.c Alternatively, you can modify the /usr/local/etc/rc.d/020.jakarta-tomcat50.sh script to use the standard $CATALINA_HOME/bin/startup.sh and other similar scripts to stop and start the server, which will permit you to set various environment variables to achieve the effect you want. Plans are afoot to produce an enhanced tomcatNNctl program: search the archives of the freebsd-java@... mailing list for more information. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 8 Dane Court Manor School Rd PGP: http://www.infracaninophile.co.uk/pgpkey Tilmanstone Tel: +44 1304 617253 Kent, CT14 0JL UK --aVD9QWMuhilNxW9f Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iQCVAwUBQqm0yZr7OpndfbmCAQIiZgP/fpv2HyjEA6Xq/wsp9bUy5tJT9P/EpbIZ 7mHiDxm6O6xSn0XW33WIGfv3+5Bme3dGSi6hJYW6fhAzswvzykKj68k0vhpiMmLX t974gjW0N9iBohNDRual4V3ogiJYi3IEIz0e2iB4FXNfVjQ73q4cLDv8nc4d4xhT 7VWHQNbmZVw= =w7nM -----END PGP SIGNATURE----- --aVD9QWMuhilNxW9f--