From owner-freebsd-java@FreeBSD.ORG Tue Apr 5 08:57:36 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 5DB4716A4CE for ; Tue, 5 Apr 2005 08:57:36 +0000 (GMT) Received: from chen.org.nz (chen.org.nz [210.54.19.51]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9332043D4C for ; Tue, 5 Apr 2005 08:57:35 +0000 (GMT) (envelope-from jonc@chen.org.nz) Received: by chen.org.nz (Postfix, from userid 1000) id 5324E56423; Tue, 5 Apr 2005 20:57:30 +1200 (NZST) Date: Tue, 5 Apr 2005 20:57:30 +1200 From: Jonathan Chen To: Kang Liu Message-ID: <20050405085730.GB18346@osiris.chen.org.nz> References: <200504041150.j34Bo7AJ021860@freefall.freebsd.org> <312615710.17152@bjut.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <312615710.17152@bjut.edu.cn> User-Agent: Mutt/1.4.2.1i cc: freebsd-java@FreeBSD.org Subject: Re: ports/38020: www/jakarta-tomcat4: stop tomcat via java -jarbootstrap.jar stop 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: Tue, 05 Apr 2005 08:57:36 -0000 On Mon, Apr 04, 2005 at 08:12:33PM +0800, Kang Liu wrote: > A draft version of daemonctl.c for tomcat has been submitted to ports/75143, > which can solve this issue. > http://www.freebsd.org/cgi/query-pr.cgi?pr=75143 There's a bit of code in here that doesn't look right: [...] if (pid2 == 0) { arguments = malloc(sizeof(char*) * 6 ); arguments[0] = "%%JAVA_HOME%%/%%JAVA_CMD%%"; arguments[1] = "-jar"; arguments[2] = %%JAVA_ARGS%%; arguments[3] = "%%APP_HOME%%/%%JAR_FILE%%"; arguments[4] = "stop"; arguments[5] = NULL; [...] } Having the %%JAVA_ARGS%% substitution follow "-jar" doesn't look correct to to me. Shouldn't the jar-file follow the "-jar" argument? A possible alternative is pick up the code from java/jboss4; remove the "jbossArgs" code in daemonctl.c, make the right substitutions in the Makefile and you'll have a daemonctl program that does accept JVM arguments, as well as having a RCng-fied startup script as well. Cheers. -- Jonathan Chen | To do is to be -- Nietzsche | To be is to do -- Sartre | Scooby do be do -- Scooby