From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 13 12:01:58 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2686C1065671 for ; Wed, 13 Aug 2008 12:01:58 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: from mired.org (five.mired.org [66.92.153.75]) by mx1.freebsd.org (Postfix) with ESMTP id CB5B98FC17 for ; Wed, 13 Aug 2008 12:01:57 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: (qmail 2280 invoked by uid 1001); 13 Aug 2008 08:00:37 -0400 Received: from bhuda.mired.org (bhuda [192.168.195.1]) by bhuda (tmda-ofmipd) with ESMTP; Wed, 13 Aug 2008 08:00:34 -0400 Date: Wed, 13 Aug 2008 08:00:32 -0400 To: Jonathan McKeown Message-ID: <20080813080032.2328a474@bhuda.mired.org> In-Reply-To: <200808131227.30125.jonathan+freebsd-hackers@hst.org.za> References: <78cb3d3f0808120810o54f49373n69ac5076c9a9c9b7@mail.gmail.com> <200808130813.56656.jonathan+freebsd-hackers@hst.org.za> <48A29E15.5080303@unsane.co.uk> <200808131227.30125.jonathan+freebsd-hackers@hst.org.za> Organization: Meyer Consulting X-Mailer: Claws Mail 3.4.0 (GTK+ 2.12.9; amd64-portbld-freebsd7.0) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEXguIzRkGnhyaz069mXhW0WHRnbrnR9WCQ6LB0CchNMAAACSUlEQVQ4jV2TQW7jMAxFGaPQOgQEdZaGMsgBrAvUA03dCxj1Uu4U2gfwQD7AGNax51NK07RcxXz6/CSl0Ij450vkPG1jzpIZM1UwDCl/xB14TWnNX8A00Qj5a0mnVFVbVUz4MeErea2HikSRqZzY894zwg9p2+/AtO8LzxFED+tNAUFeU29iFOLRxlZAcdo9A8wi8ZBMV4BKPde82Oxrvs6BTkulQIClte0DLFzzsKk9j1MBex8iUaP00Bd78S/muyFScrTXz6zLkEUxJp+SabQfNOs4f4Jpx5qSZ/304PWwlEWP1cOn/mJQR7EOD+uKhjcBLziuL7xoY5Xm+VFAUSw/LwwwsHEHxihpwV4EJH0xXRkbw1PkRw+X4pEuSJwBggqk+HEYKkiL5/74/nQkogigzQsAFrakxZyfw3wMIEEZPv4AWMfxwqE5GNxGaERjmH+PG8AE0L4/w9g0lsp1raLYAN5azQa+AOoO9NwcpFkTrG2VKNMNEL5UKUUAw34tha0z7onUG0oBoNtczE04GwFE3wCHc0ChezAJ6A1WMV81AtY7wDAJSlXwV+4cwBvsOsrQMRawfQEBz0deEZ7WNpV2szckIKo5VpDHDSDvF1GItwqqAlG01Hh50BGtVhuUkjkasg/14bYFGCgWg1fSWHvmOoJck2xdp9ZvZBHzDVTzX23TkrOn7qe5U2COEw5D4Vx3qEQpFY2Z/3QFnJxzp7YCmSMG19nOUoe869zZfOQb5ywQuWu0yCn5+8gxZz+BE7vG3j4/wbf4D/sXN9Wug1s7AAAAAElFTkSuQmCC Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Mike Meyer Cc: freebsd-hackers@freebsd.org Subject: Re: If not the force, what should I use? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2008 12:01:58 -0000 On Wed, 13 Aug 2008 12:27:30 +0200 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. 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.... 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