On Sat, Jan 31, 2015 at 07:55:46AM +0100, Ingo Schwarze wrote:
> Hi Joel,
> 
> Joel Rees wrote on Sat, Jan 31, 2015 at 03:16:02PM +0900:
> 
> > What I'm thinking of is a tool that would allow one to query
> > whether a daemon is installed,
> 
> pkg_info(1)

Or if by deamon you mean an rc.d script, running the following command will 
display all currently available services along with their currently defined 
rc.conf flags:
$ rcctl getall

If you want to know which flags a particular daemon is using, you can run:
$ rcctl get identd flags
NO                              # <- output the currently configured flags
$ rcctl getdef identd flags
-e                              # <- output the default flags for when the 
daemon is enabled

You can get even more information if you don't pass any argument, e.g:
$ rcctl get identd
identd_flags=NO
identd_timeout=30
identd_user=root

As for start|stop|restart..., all rc.d scripts take the same arguments: start, 
stop, restart, reload, check.
Some do not support a particular action (some daemons for e.g. do not support 
reloading their configuration, so "reload" does not work) -- in this case, 
running the script without argument will tell you:
# /etc/rc.d/spamd
usage: /etc/rc.d/spamd [-df] start|stop|restart|check
# /etc/rc.d/sshd
usage: /etc/rc.d/sshd [-df] start|stop|restart|reload|check

I have that answers some of your questions.

-- 
Antoine

Reply via email to