From owner-freebsd-questions@FreeBSD.ORG Thu Jun 11 22:07:48 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B15C6106566B for ; Thu, 11 Jun 2009 22:07:48 +0000 (UTC) (envelope-from prvs=40649701e=pauls@utdallas.edu) Received: from ip-relay-001.utdallas.edu (ip-relay-001.utdallas.edu [129.110.20.111]) by mx1.freebsd.org (Postfix) with ESMTP id 785808FC1E for ; Thu, 11 Jun 2009 22:07:48 +0000 (UTC) (envelope-from prvs=40649701e=pauls@utdallas.edu) X-Group: RELAYLIST X-IronPort-AV: E=Sophos;i="4.42,204,1243832400"; d="scan'208";a="13333305" Received: from smtp3.utdallas.edu ([129.110.20.110]) by ip-relay-001.utdallas.edu with ESMTP; 11 Jun 2009 16:38:59 -0500 Received: from utd65257.utdallas.edu (utd65257.utdallas.edu [129.110.3.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp3.utdallas.edu (Postfix) with ESMTPSA id AE0774EF43; Thu, 11 Jun 2009 16:38:59 -0500 (CDT) Date: Thu, 11 Jun 2009 21:38:55 +0000 From: Paul Schmehl To: Drew Tomlinson Message-ID: In-Reply-To: <4A310A97.7050504@mykitchentable.net> References: <6322EB049C37BA76C25CD076@Macintosh-2.local> <4A30674D.1040804@mykitchentable.net> <84015F2050B2B2480B0E0C49@Macintosh-2.local> <4A310A97.7050504@mykitchentable.net> X-Mailer: Mulberry/4.0.6 (Linux/x86) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=sha1; protocol="application/pkcs7-signature"; boundary="==========F6041C8F52C65346AFFB==========" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@FreeBSD.org Subject: Re: Help With rc.d Script -- SOLVED X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 22:07:49 -0000 --==========F6041C8F52C65346AFFB========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline --On Thursday, June 11, 2009 08:45:59 -0500 Drew Tomlinson=20 wrote: > > The problem here is that urchinctl does not write a pid file by default > and I can't figure out how to make it do so. > > However in reading man rc.subr, I found argument_cmd that works for me. > By setting argument_cmd, I can override the default methods called by > run_rc_command. Thus I set these three lines: > > start_cmd=3D"/usr/local/urchin/bin/urchinctl start" > stop_cmd=3D"/usr/local/urchin/bin/urchinctl stop" > status_cmd=3D"/usr/local/urchin/bin/urchinctl status" > > Originally, I used "$1" instead of start, stop, and status. However > this had the effect of making "restart" restart twice, once for the > start method and once for the stop method because > "/usr/local/urchin/bin/urchinctl restart" was being run each time. > >> If that does work, your script should at least be able to report the >> status (running or not). > > I also had to set the procname variable to make the status method > available. In my case, it didn't matter to what it was set as the > urchinctl command handled the actual status reporting. > >> I'm assuming that, because root is running the lowest numbered >> process, killing that process will kill all the children as well. > Killing the root process killed all the urchinwebd processes but left > the urchind processes hanging around. But no matter, I got things working. > Drew, I'm glad you were able to get it working. There may be a way to kill the = urchind processes as well. If you set procname to urchin, the rc.subr script=20 might understand that to mean any process that begins with that string. I=20 haven't tested it, but looking at the script (/etc/rc.subr), it appears to me=20 to be the case. If that doesn't work, perhaps procname urchin* would. --=20 Paul Schmehl (pauls@utdallas.edu) Senior Information Security Analyst The University of Texas at Dallas http://www.utdallas.edu/ir/security/ --==========F6041C8F52C65346AFFB==========--