Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jun 2005 16:42:01 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Ilia Chipitsine <ilia@paramon.ru>
Cc:        questions@freebsd.org
Subject:   Re: passing custom parameters to java when starting tomcat ?
Message-ID:  <20050610154201.GB15391@lack-of-gravitas.thebunker.net>
In-Reply-To: <20050610184040.P38348@office.paramon.ru>
References:  <20050610184040.P38348@office.paramon.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050610154201.GB15391>