get_pidfile_from_conf usage

Chris Rees utisoft at gmail.com
Sat May 21 06:58:11 UTC 2011


On 20 May 2011 17:39, Doug Barton <dougb at freebsd.org> wrote:
> On 19/05/2011 12:15, Chris Rees wrote:
>>
>> Hi all,
>>
>> I know it's been done to death recently, and there're examples in
>> slim, but I'd just like some clarity here -- I'm sticking it into
>> musicpd.in.
>
> slim is a particularly odd/complex case due to the way that it is tied
> deeply to X. named and devd are simpler examples.
>
>> Is it absolutely necessary to define a precmd and postcmd to get the
>> pidfile, or can I just set prestart_cmd=find_pidfile&&
>> prestop_cmd=find_pidfile?
>
> It needs to be run in both start and stop _precmd because both need to know
> the pid file location. You need to test for the function's existence in
> ports because it won't be there for all systems we support for years yet.
> However, the feature has been MFC'ed so it will be in all of the next
> releases.
>
> You could use the find_pidfile method from slim, and if I understand what
> you're asking above, and you have no other start/stop _precmd you could do
> the following:
>
> start_precmd=find_pidfile
> stop_precmd=find_pidfile

You have understood exactly what I was asking, thanks.

>
>> How do I get status working properly; it doesn't look right in slim...
>
> Works fine for me:
>
> # service named status
> named is running as pid 1532.
>
> # service slim status
> slim is running as pid 1791.

Oh yes, I know it _works_, but it's ignorant of $pidfile. Is this OK?

Chris


More information about the freebsd-rc mailing list