Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 May 2011 07:57:39 +0100
From:      Chris Rees <utisoft@gmail.com>
To:        Doug Barton <dougb@freebsd.org>
Cc:        freebsd-rc@freebsd.org
Subject:   Re: get_pidfile_from_conf usage
Message-ID:  <BANLkTim3xPkto1VunBcNBx-yk%2B-9NLO3iw@mail.gmail.com>
In-Reply-To: <4DD6993F.3080709@FreeBSD.org>
References:  <BANLkTin22u9QvvoxCGf44vw_pr0ZMeo8PQ@mail.gmail.com> <4DD6993F.3080709@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 20 May 2011 17:39, Doug Barton <dougb@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTim3xPkto1VunBcNBx-yk%2B-9NLO3iw>