Date: Tue, 05 Jan 2010 09:56:13 -0800 From: Doug Barton <dougb@FreeBSD.org> To: Yevgen Krapiva <ykrapiva@gmail.com> Cc: freebsd-rc@freebsd.org Subject: Re: Need help with shutdowning a java process Message-ID: <4B437D3D.6070209@FreeBSD.org> In-Reply-To: <1262677911.2694.11.camel@kv-po-ykrapivanb.umc.com.ua> References: <1262677911.2694.11.camel@kv-po-ykrapivanb.umc.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B437D3D.6070209>