From owner-freebsd-rc@FreeBSD.ORG Tue Jan 5 08:18:33 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 30F6A1065676 for ; Tue, 5 Jan 2010 08:18:33 +0000 (UTC) (envelope-from ykrapiva@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id B80268FC12 for ; Tue, 5 Jan 2010 08:18:32 +0000 (UTC) Received: by ewy26 with SMTP id 26so13956948ewy.3 for ; Tue, 05 Jan 2010 00:18:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer; bh=GTwSXWqB3o19eXiqlSPUQ8O3aLCriCFqawcwFaLZtYo=; b=eazEmYVFvo3WF4XdjKISLBTMIRIgWEPM6wxQDchYgCs3yJ2q34saQcKMMB5UrvgqsT bAINgmPjWQsgXJg4kE8QVXQ1wkNMNupCiskAux+Q+Bc6YWcXdrvUWGIge1KARj7pB4SX 6BhN7AGBycT3irEYHXVbP1cHCka+1dcul2EQM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer; b=UuI5aX25Qflto1b+EUC+Sm8MmSzqteB836RSNr7NA+dtWVsWOcQzyXN25kihZ6hkhP CY2J8gLIQ1lJ8w+mK2u4uNz3gZHjcokq3m6xMFIUFcTxS+05T5yTOC5d6GN9k5evIrfY jrhos6lbNf70dYIcIGwQQpmrKgaFG1eG0Og5E= Received: by 10.213.99.138 with SMTP id u10mr4301248ebn.12.1262677916487; Mon, 04 Jan 2010 23:51:56 -0800 (PST) Received: from ?77.52.109.96? ([77.52.109.96]) by mx.google.com with ESMTPS id 14sm13121454ewy.15.2010.01.04.23.51.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 04 Jan 2010 23:51:55 -0800 (PST) From: Yevgen Krapiva To: freebsd-rc@freebsd.org Date: Tue, 05 Jan 2010 09:51:51 +0200 Message-ID: <1262677911.2694.11.camel@kv-po-ykrapivanb.umc.com.ua> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 FreeBSD GNOME Team Port Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: 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 08:18:33 -0000 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@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 ?