Setting java properties for tomcat5.0
Roberto Nunnari
roberto.nunnari at supsi.ch
Mon Feb 14 02:59:59 PST 2005
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 at 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========================
More information about the freebsd-java
mailing list