If not the force, what should I use?
Vincent Hoffman
vince at unsane.co.uk
Wed Aug 13 10:42:41 UTC 2008
Jonathan McKeown wrote:
> On Wednesday 13 August 2008 10:40:53 Vincent Hoffman wrote:
>
>> Jonathan McKeown wrote:
>>
>>
>>> People keep talking about forcestart.
>>>
>>> Unless I'm misunderstanding things horribly, forcestart does exactly that
>>> - forces the service to start regardless of any error that may occur.
>>>
>>> The better option for starting something as a one-off (not enabled in
>>> rc.conf) is mnemonically named onestart - which only ignores the rcvar
>>> but still fails on any other error.
>>>
>>> And yes, I like having onestart/onestop distinguished from start/stop.
>>>
>> I believe it "forces" a start even though its not actually enabled (in
>> rc.conf) rather than regardless of errors.
>> If you really want a command line of onestart/onestop install the
>> sysutils/bsdadminscripts port which has a script called rconestart and
>> rconestop which do exactly that ;)
>>
>
> No, you don't need to install anything - it's part of rc.subr.
>
> From the rc.subr(8) manpage:
>
> argument may have one of the following prefixes which alters its
> operation:
>
> fast Skip the check for an existing running process, and
> sets rc_fast=YES.
>
> 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.
>
> I certainly use onestart - generally when I'm configuring and testing a new
> service before enabling it in rc.conf.
>
> I also use it with NFS. Whenever I've changed /etc/exports, I force mountd to
> reread it by issuing
>
> /etc/rc.d/mountd onereload
>
>
Doh I just skimmed though /etc/rc.subr not the manpage, thanks for the
pointers.
Vince
> Jonathan
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>
More information about the freebsd-hackers
mailing list