From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 13 10:25:21 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 BAD80106564A for ; Wed, 13 Aug 2008 10:25:21 +0000 (UTC) (envelope-from jonathan+freebsd-hackers@hst.org.za) Received: from hermes.hst.org.za (onix.hst.org.za [209.203.2.133]) by mx1.freebsd.org (Postfix) with ESMTP id 40FB78FC16 for ; Wed, 13 Aug 2008 10:25:19 +0000 (UTC) (envelope-from jonathan+freebsd-hackers@hst.org.za) Received: from sysadmin.hst.org.za (sysadmin.int.dbn.hst.org.za [10.1.1.20]) (authenticated bits=0) by hermes.hst.org.za (8.13.8/8.13.8) with ESMTP id m7DAKLOT068937 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 13 Aug 2008 12:20:21 +0200 (SAST) (envelope-from jonathan+freebsd-hackers@hst.org.za) From: Jonathan McKeown Organization: Health Systems Trust To: freebsd-hackers@freebsd.org User-Agent: KMail/1.9.7 References: <78cb3d3f0808120810o54f49373n69ac5076c9a9c9b7@mail.gmail.com> <200808130813.56656.jonathan+freebsd-hackers@hst.org.za> <48A29E15.5080303@unsane.co.uk> In-Reply-To: <48A29E15.5080303@unsane.co.uk> X-Face: $@VrUx^RHy/}yu]jKf/<4T%/d|F+$j-Ol2"2J$q+%OK1]&/G_S9(=?iso-8859-1?q?HkaQ*=60!=3FYOK=3FY!=27M=60C=0A=09aP=5C9nVPF8Q=7DCilHH8l?= =?iso-8859-1?q?=3B=7E!42HK6=273lg4J=7Daz?=@1Dqqh:J]M^"YPn*2IWrZON$1+G?oX3@ =?iso-8859-1?q?k=230=0A=0954XDRg=3DYn=5FF-etwot4U=24b?=dTS{i X-Spam-Score: -4.399 () ALL_TRUSTED,BAYES_00 X-Scanned-By: MIMEDefang 2.61 on 209.203.2.133 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 10:25:21 -0000 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 th= at > > - 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. =46rom 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=3DYES. force Skip the checks for rcvar being set to ``YES'', and sets rc_force=3DYES. 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= =20 service before enabling it in rc.conf. I also use it with NFS. Whenever I've changed /etc/exports, I force mountd = to=20 reread it by issuing /etc/rc.d/mountd onereload Jonathan