Need help with shutdowning a java process
    Doug Barton 
    dougb at FreeBSD.org
       
    Tue Jan  5 17:56:09 UTC 2010
    
    
  
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
    
    
More information about the freebsd-rc
mailing list