Date: Wed, 13 Aug 2008 08:00:32 -0400 From: Mike Meyer <mwm-keyword-freebsdhackers2.e313df@mired.org> To: Jonathan McKeown <jonathan+freebsd-hackers@hst.org.za> Cc: freebsd-hackers@freebsd.org Subject: Re: If not the force, what should I use? Message-ID: <20080813080032.2328a474@bhuda.mired.org> In-Reply-To: <200808131227.30125.jonathan%2Bfreebsd-hackers@hst.org.za> References: <78cb3d3f0808120810o54f49373n69ac5076c9a9c9b7@mail.gmail.com> <200808130813.56656.jonathan%2Bfreebsd-hackers@hst.org.za> <48A29E15.5080303@unsane.co.uk> <200808131227.30125.jonathan%2Bfreebsd-hackers@hst.org.za>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 13 Aug 2008 12:27:30 +0200 Jonathan McKeown <jonathan+freebsd-hackers@hst.org.za> 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. In that case, someone should file a doc bug for the rc(8) manpage, which says: Each script is expected to support at least the following arguments, which are automatically supported if it uses the run_rc_command() func- tion: start Start the service. This should check that the service is to be started as specified by rc.conf(5). Also checks if the service is already running and refuses to start if it is. This latter check is not performed by standard FreeBSD scripts if the system is starting directly to multi-user mode, to speed up the boot process. If forcestart is given, ignore the rc.conf(5) check and start anyway. stop If the service is to be started as specified by rc.conf(5), stop the service. This should check that the service is running and complain if it is not. If forcestop is given, ignore the rc.conf(5) check and attempt to stop. I don't have time to do it now, but will later if no one says they have.... <mike -- Mike Meyer <mwm@mired.org> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080813080032.2328a474>