get_pidfile_from_conf usage

Doug Barton dougb at FreeBSD.org
Fri May 20 16:39:51 UTC 2011


On 05/19/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

> 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.


hth,

Doug

-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/



More information about the freebsd-rc mailing list