Need help with shutdowning a java process
    Yevgen Krapiva 
    ykrapiva at gmail.com
       
    Tue Jan  5 08:18:33 UTC 2010
    
    
  
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"
# 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.
if [ -f $pidfile ]; then
  read rc_pid junk < $pidfile
  if [ ! -z "$rc_pid" ]; then
    procname=`ps -o command= $rc_pid`
    echo rc_pid=$rc_pid
    echo procname=$procname
  fi
fi
run_rc_command "$1"
The service starts well but I can't check the status or shutdown it.
root at etc/rc.d #./openjsip-location-service onestatus
rc_pid=34459
procname=/usr/local/diablo-jdk1.6.0/bin/java
-cp :/usr/local/share/openjsip/lib/jain-sdp-1.0.115.jar:/usr/local/share/openjsip/lib/jain-sip-api-1.2.jar:/usr/local/share/openjsip/lib/jai
./openjsip-location-service: WARNING: no shebang line
in /usr/local/diablo-jdk1.6.0/bin/java
openjsip_location_service is not running.
What does it want from me saying that "./openjsip-location-service:
WARNING: no shebang line in /usr/local/diablo-jdk1.6.0/bin/java" ?
Can anybody help ?
    
    
More information about the freebsd-rc
mailing list