Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jun 2009 21:38:55 +0000
From:      Paul Schmehl <pauls@utdallas.edu>
To:        Drew Tomlinson <drew@mykitchentable.net>
Cc:        freebsd-questions@FreeBSD.org
Subject:   Re: Help With rc.d Script -- SOLVED
Message-ID:  <CDF2A04B7AC20392B4A3DE3D@utd65257.utdallas.edu>
In-Reply-To: <4A310A97.7050504@mykitchentable.net>
References:  <6322EB049C37BA76C25CD076@Macintosh-2.local> <4A30674D.1040804@mykitchentable.net> <84015F2050B2B2480B0E0C49@Macintosh-2.local> <4A310A97.7050504@mykitchentable.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--==========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
<drew@mykitchentable.net> 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==========--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CDF2A04B7AC20392B4A3DE3D>