From owner-freebsd-rc@FreeBSD.ORG Tue Jan 5 17:56:09 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16B4B106566B for ; Tue, 5 Jan 2010 17:56:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id BEEA48FC0A for ; Tue, 5 Jan 2010 17:56:08 +0000 (UTC) Received: (qmail 15762 invoked by uid 399); 5 Jan 2010 17:56:08 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 5 Jan 2010 17:56:08 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B437D3D.6070209@FreeBSD.org> Date: Tue, 05 Jan 2010 09:56:13 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Yevgen Krapiva References: <1262677911.2694.11.camel@kv-po-ykrapivanb.umc.com.ua> In-Reply-To: <1262677911.2694.11.camel@kv-po-ykrapivanb.umc.com.ua> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: Need help with shutdowning a java process X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 17:56:09 -0000 To start with, you should really read the article at http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html, I think it would help you get a picture of how some of this should look. Some more comments below. Yevgen Krapiva wrote: > Hi all, > > I have the following rc script: > > .. > name="openjsip_location_service" > .. > # Execution command > runcmd="java -cp $CLASSPATH -Djava.security.policy=conf/policy.all > -Djava.rmi.server.codebase=\"file://$OPENJSIP_REMOTE_LIB > file://$JAIN_SIP_API_LIB\" openjsip.locationservice.LocationService > conf/location-service.properties" > > pidfile="/var/run/${name}.pid" > command="/usr/sbin/daemon" > flags="-p ${pidfile} $runcmd" Rather than having 2 different variables, you should combine your "flags" and "runcmd" variables into command_args, which is the usual way to accomplish what you seem to be trying to accomplish. > # When I run java from /usr/local/bin I run javavm indeed (convenient > wrapper for switching Java VMs). > # So I need to get the correct processname from output of 'ps' command > > # Subvert the check_pidfile procname check. Yeah, let's not subvert stuff. :) I'm not really familiar with java, but what I think you need to do is to set "command_interpreter=/usr/local/diablo-jdk1.6.0/bin/java" which should give rc.subr the information it needs to find your process. If that doesn't work, do 'ps -auxww | grep openjsip' and show us the results. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso