From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Dec 16 10:10:19 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F25A616A4CE for ; Thu, 16 Dec 2004 10:10:18 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C650A43D39 for ; Thu, 16 Dec 2004 10:10:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iBGAAIVN001028 for ; Thu, 16 Dec 2004 10:10:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iBGAAIAw001027; Thu, 16 Dec 2004 10:10:18 GMT (envelope-from gnats) Resent-Date: Thu, 16 Dec 2004 10:10:18 GMT Resent-Message-Id: <200412161010.iBGAAIAw001027@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Anton Yudin Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CFEC616A4CF for ; Thu, 16 Dec 2004 10:05:44 +0000 (GMT) Received: from ib.com.ua (ib.com.ua [217.144.67.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3D1F43D2D for ; Thu, 16 Dec 2004 10:05:43 +0000 (GMT) (envelope-from toha@ib.com.ua) Received: from ib.com.ua (localhost.ib.com.ua [127.0.0.1]) by ib.com.ua (8.13.1/8.12.10) with ESMTP id iBGA5Ton049205 for ; Thu, 16 Dec 2004 12:05:29 +0200 (EET) (envelope-from toha@ib.com.ua) Received: (from toha@localhost) by ib.com.ua (8.13.1/8.12.10/Submit) id iBGA5OTE049204; Thu, 16 Dec 2004 12:05:24 +0200 (EET) (envelope-from toha) Message-Id: <200412161005.iBGA5OTE049204@ib.com.ua> Date: Thu, 16 Dec 2004 12:05:24 +0200 (EET) From: Anton Yudin To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/75143: There is no way to specify jvm parameters when starting jakarta-tomcat. X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Anton Yudin List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2004 10:10:19 -0000 >Number: 75143 >Category: ports >Synopsis: There is no way to specify jvm parameters when starting jakarta-tomcat. >Confidential: no >Severity: non-critical >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Dec 16 10:10:18 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Anton Yudin >Release: FreeBSD 4.10-STABLE i386 >Organization: >Environment: System: FreeBSD .ua 4.10-STABLE FreeBSD 4.10-STABLE #0: Fri Oct 15 17:10:27 EEST 2004 root@.ua:/obj/usr/src/sys/ i386 >Description: There is no way to specify jvm parameters when starting jakarta-tomcat. >How-To-Repeat: >Fix: Patch www/jakarta-tomcat5/Makefile and www/jakarta-tomcat4/files/daemonctl.c Now it is possible to specify parameters for jvm in such way: tomcat50ctl start [jvm-arguments] for example: tomcat50ctl start -server -Xmx128m *** www/jakarta-tomcat5/Makefile.original Tue Dec 14 16:38:37 2004 --- www/jakarta-tomcat5/Makefile Tue Dec 14 16:18:02 2004 *************** *** 124,131 **** @${ECHO_CMD} -n ">> Compiling and installing control program..." @${SED} \ ! -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} --- 124,131 ---- @${ECHO_CMD} -n ">> Compiling and installing control program..." @${SED} \ ! -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} *** www/jakarta-tomcat4/files/daemonctl.c.original Thu Oct 10 02:10:32 2002 --- www/jakarta-tomcat4/files/daemonctl.c Thu Dec 16 11:48:24 2004 *************** *** 57,62 **** --- 57,64 ---- private void restart(void); + char** applicationArguments = NULL; + /** * Main function. This function is called when this program is executed. * *************** *** 84,93 **** --- 86,97 ---- argument = argv[1]; if (strcmp("start", argument) == 0) { + applicationArguments = argv + 2; start(); } else if (strcmp("stop", argument) == 0) { stop(); } else if (strcmp("restart", argument) == 0) { + applicationArguments = argv + 2; restart(); } else { fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Illegal argument \"%s\".\n", argument); *************** *** 313,318 **** --- 317,325 ---- int stdoutLogFile; int stderrLogFile; struct stat sb; + char** arguments = NULL; + int ac = 0; + int i = 0; /* Open and read the PID file */ printf(">> Reading PID file (%%PID_FILE%%)..."); *************** *** 415,420 **** --- 422,449 ---- if (pid == 0) { + if (applicationArguments != NULL) + for (;applicationArguments[ac] != NULL;ac++) + + fprintf(stderr, "ac = %i\n", ac); + + arguments = malloc(sizeof(char*) * 6 + ac); + + arguments[0] = "%%JAVA_HOME%%/%%JAVA_CMD%%"; + for (i = 0; i < ac; i++) + arguments[1 + i] = applicationArguments[i]; + arguments[1 + i] = "-jar"; + arguments[2 + i] = "%%JAVA_ARGS%%"; + arguments[3 + i] = "%%JAR_FILE%%"; + arguments[4 + i] = "%%JAR_ARGS%%"; + arguments[5 + i] = NULL; + + #ifdef DEBUG + for (ac = 0; ac < i + 5; ac++) { + fprintf(stderr, "arg[%i] = (%s)\n", ac, arguments[ac]); + } + #endif + /* Redirect stdout to log file */ dup2(stdoutLogFile, STDOUT_FILENO); *************** *** 425,431 **** file using pipe(2) */ /* Execute the command */ ! execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", %%JAVA_ARGS%% "%%JAR_FILE%%", %%JAR_ARGS%% NULL); fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to start %%APP_TITLE%% %%PORTVERSION%% since '%%JAVA_HOME%%/%%JAVA_CMD%% -jar %%JAR_FILE%%' in %%APP_HOME%%: "); perror(NULL); --- 454,460 ---- file using pipe(2) */ /* Execute the command */ ! execv("%%JAVA_HOME%%/%%JAVA_CMD%%", arguments); fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to start %%APP_TITLE%% %%PORTVERSION%% since '%%JAVA_HOME%%/%%JAVA_CMD%% -jar %%JAR_FILE%%' in %%APP_HOME%%: "); perror(NULL); >Release-Note: >Audit-Trail: >Unformatted: