Re: not adding daemons to rc.conf



On 31/08/2006 05:25, Daniel Bye wrote:
On Wed, Aug 30, 2006 at 08:47:06PM -0500, Jonathan Horne wrote:
ive noticed that apache can be started manually using the apachectl tool, even> if it is not enabled in /etc/rc.conf. do many other daemons have this
ability? i have a dev server that i would like to not have many things
enabled in the rc.conf, but i would like an easy way to just start specific
daemons when i need.

There is the "force" modifier which may be of help/interest. It works
like this:

# /usr/local/etc/rc.d/script forcestart

This will, well, force the script to run, even if it's not explicitly
enabled in /etc/rc.conf.

It does more, it will force the script to run even if a daemon is
running. What OP is looking for is 'one' prefix:

# /usr/local/etc/rc.d/script onestart
# /usr/local/etc/rc.d/script onestop

After rc.subr(8) manpage:

------
run_rc_command argument
[...]
force Skip the checks for rcvar being set to ``YES'', and
sets rc_force=YES. This ignores argument_precmd
returning non-zero, and ignores any of the required_*
tests failing, and always returns a zero exit status.

one Skip the checks for rcvar being set to ``YES'', but
performs all the other prerequisite tests.
------

HTH,

Karol

--
Karol Kwiatkowski <freebsd at orchid dot homeunix dot org>
OpenPGP: http://www.orchid.homeunix.org/carlos/gpg/0x06E09309.asc

Attachment: signature.asc
Description: OpenPGP digital signature



Relevant Pages

  • Re: samba config problems
    ... Run the script without any commands to see usage. ... 'rcvar' argument; e.g. ... Note that nothign is stopping you from running smbd and nmbd manually, ... the rc control script simply automates the control of the daemon for you. ...
    (freebsd-questions)
  • Re: BIND9 wont start
    ... prefixing your commands with the 'force' keyword (e.g. ... /etc/rc.d/named forcestart, etc.) ... force Skip the checks for rcvar being set to ``YES'', ... tests failing, and always returns a zero exit status. ...
    (freebsd-questions)
  • Re: BIND9 wont start
    ... prefixing your commands with the 'force' keyword (e.g. ... /etc/rc.d/named forcestart, etc.) ... force Skip the checks for rcvar being set to ``YES'', ... tests failing, and always returns a zero exit status. ...
    (freebsd-questions)
  • Re: set_rcvar load_rc_config run_rc_command: all not found
    ... The script that wants to run the functions ... > missing functions available to your script. ... Karol Kwiatkowski <freebsd at orchid dot homeunix dot org> ...
    (freebsd-questions)
  • Re: samba config problems
    ... will not start or stop the samba process. ... Run the script without any commands to see usage. ... 'rcvar' argument; e.g. ... Note that nothign is stopping you from running smbd and nmbd manually, ...
    (freebsd-questions)