From owner-freebsd-java@FreeBSD.ORG Mon Feb 14 10:59:59 2005 Return-Path: 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 0806C16A4CE for ; Mon, 14 Feb 2005 10:59:59 +0000 (GMT) Received: from mail.dti.supsi.ch (mail.dti.supsi.ch [193.5.153.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 423DB43D2F for ; Mon, 14 Feb 2005 10:59:57 +0000 (GMT) (envelope-from roberto.nunnari@supsi.ch) Received: from [193.5.152.27] (pcm2027.dti.supsi.ch [193.5.152.27]) by mail.dti.supsi.ch (8.11.6/8.11.6) with ESMTP id j1EAxr019408; Mon, 14 Feb 2005 11:59:53 +0100 Message-ID: <421084A6.3040508@supsi.ch> Date: Mon, 14 Feb 2005 11:59:50 +0100 From: Roberto Nunnari User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Roberto Nunnari References: <20050211122826.GB61803@gravitas.thebunker.net> <20050211161913.GA67712@gravitas.thebunker.net> <420CEEFC.90302@supsi.ch> In-Reply-To: <420CEEFC.90302@supsi.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-java@freebsd.org Subject: Re: Setting java properties for tomcat5.0 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2005 10:59:59 -0000 Hi. Here are the modifications I made to the Makefile and daemonctl.c Note that I had to modify daemonctl.c only because I don't know sed well enough.. if somebody knows how to do it using %%JAVA_OPTS%% instead of adding %%MYARGS%% then I'd be glad to know. *********************************************************** -bash-2.05b# diff /root/mytomcatdaemon/daemonctl.c /usr/ports/www/jakarta-tomcat4 jakarta-tomcat4 jakarta-tomcat41 -bash-2.05b# diff /root/mytomcatdaemon/daemonctl.c /usr/ports/www/jakarta-tomcat4/files/daemonctl.c 428,429c428 < /* execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", %%JAVA_ARGS%% "%%JAR_FILE%%", %%JAR_ARGS%% NULL);*/ < execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", %%MYARGS%% %%JAVA_ARGS%% "-jar", "bin/bootstrap.jar", %%JAR_ARGS%% NULL); --- > execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", %%JAVA_ARGS%% "%%JAR_FILE%%", %%JAR_ARGS%% NULL); *********************************************************** and then add the following lines at the end of your tomcat makefile but before the final .include directive: *********************************************************** -bash-2.05b# tail -n14 /usr/ports/www/jakarta-tomcat41/Makefile miodaemon: @${ECHO_MSG} -n ">> Compiling and installing control program..." @${SED} \ -e "/%%MYARGS%%/s//\"-Djava.awt.headless=true\",/g" \ -e "/%%JAVA_ARGS%%/s//\"-Dcatalina.home=${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 @${CP} ${WRKDIR}/${CONTROL_SCRIPT_NAME} ${CONTROL_SCRIPT} @${CHOWN} ${USER}:${GROUP} ${CONTROL_SCRIPT} @${CHMOD} 6754 ${CONTROL_SCRIPT} @${ECHO_MSG} " [ DONE ]" .include *********************************************************** Best regards. Roberto Nunnari wrote: > I had to modify daemonctl and Makefile.. not sure I still > have them around.. but it's just 10 minutes work once you > make you're way round.. If I find them I'll send to you. > > Best regards. > > Matthew Seaman wrote: > >> On Fri, Feb 11, 2005 at 04:47:25PM +0200, Achilleus Mantzios wrote: >> >>> O Matthew Seaman ?????? ???? Feb 11, 2005 : >>> >>> >>>> Dear list, >>>> >>>> I've got a standard installation of the www/jakarta-tomcat5 port, >>>> which is working pretty well. However I need to start tomcat >>>> including setting the 'java.awt.headless=true' property. >>> >>> >>> Why dont you edit >>> /usr/local/jakarta-tomcat5.0/bin/catalina.sh >>> and put a >>> -Djava.awt.headless=true \ >>> line at the appropriate location. >>> >>> Use this catalina.sh instead of tomcat50ctl. >>> >> >> >> That's certainly a possibility, but it means you need root access in >> order to bounce the tomcat server (ie. because the rc.d script will >> use su(1) to change the tomcat process to running as user www:www) If >> I can avoid that necessity it would be good. >> >> Cheers, >> >> Matthew >> > > -- Roberto Nunnari -software engineer- mailto:roberto.nunnari@supsi.ch Scuola Universitaria Professionale della Svizzera Italiana Dipartimento Tecnologie Innovative http://www.dti.supsi.ch SUPSI-DTI Via Cantonale tel: +41-91-6108561 6928 Manno """ fax: +41-91-6108570 Switzerland (o o) =======================oOO==(_)==OOo========================