Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Feb 2005 11:59:50 +0100
From:      Roberto Nunnari <roberto.nunnari@supsi.ch>
To:        Roberto Nunnari <roberto.nunnari@supsi.ch>
Cc:        freebsd-java@freebsd.org
Subject:   Re: Setting java properties for tomcat5.0
Message-ID:  <421084A6.3040508@supsi.ch>
In-Reply-To: <420CEEFC.90302@supsi.ch>
References:  <20050211122826.GB61803@gravitas.thebunker.net> <Pine.LNX.4.44.0502111639400.9012-100000@matrix.gatewaynet.com> <20050211161913.GA67712@gravitas.thebunker.net> <420CEEFC.90302@supsi.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <bsd.port.post.mk>

***********************************************************

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



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