From owner-freebsd-geom@FreeBSD.ORG Sat Sep 11 23:53:47 2004 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BCAD16A4CE; Sat, 11 Sep 2004 23:53:47 +0000 (GMT) Received: from gromit.dlib.vt.edu (gromit.dlib.vt.edu [128.173.49.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id 27C8243D2D; Sat, 11 Sep 2004 23:53:47 +0000 (GMT) (envelope-from paul@gromit.dlib.vt.edu) Received: from hawkwind.Chelsea-Ct.Org (pool-151-199-91-61.roa.east.verizon.net [151.199.91.61]) by gromit.dlib.vt.edu (8.13.1/8.13.1) with ESMTP id i8BNrhc9024096 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 11 Sep 2004 19:53:45 -0400 (EDT) (envelope-from paul@gromit.dlib.vt.edu) Received: from [192.168.1.25] (zappa [192.168.1.25])i8BNrbNR015391; Sat, 11 Sep 2004 19:53:38 -0400 (EDT) From: Paul Mather To: hartzell@kestrel.alerce.com In-Reply-To: <16707.28763.7201.383177@rosebud.alerce.com> References: <16706.33472.228042.851882@rosebud.alerce.com> <20040911074556.GI30151@darkness.comp.waw.pl> <16707.25008.865268.555842@rosebud.alerce.com> <16707.28763.7201.383177@rosebud.alerce.com> Content-Type: text/plain Message-Id: <1094946816.59283.75.camel@zappa.Chelsea-Ct.Org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sat, 11 Sep 2004 19:53:36 -0400 Content-Transfer-Encoding: 7bit cc: Pawel Jakub Dawidek cc: freebsd-geom@freebsd.org Subject: Re: Mounting root... X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2004 23:53:47 -0000 On Sat, 2004-09-11 at 17:38, George Hartzell wrote: > Sorry to follow up my own posting, but I have something that works. > > Two changes to /etc/rc.d/swap1 > > change stop_cmd from ':' to 'swap1_stop' > > and change the line in swap1_stop from > > swapctl -U -t blk > > to > > swapoff -a The /etc/rc.d/swap1 on FreeBSD-CURRENT is very close to that on my NetBSD-CURRENT box. Here are the diffs: --- freebsd_swap1 2004-09-11 19:19:18.000000000 -0400 +++ netbsd_swap1 2004-09-11 19:25:03.000000000 -0400 @@ -1,18 +1,17 @@ #!/bin/sh # # $NetBSD: swap1,v 1.8 2002/03/24 15:52:41 lukem Exp $ -# $FreeBSD: src/etc/rc.d/swap1,v 1.6 2004/03/08 12:25:05 pjd Exp $ # # PROVIDE: localswap # REQUIRE: disks -# KEYWORD: FreeBSD nojail shutdown +# KEYWORD: shutdown . /etc/rc.subr name="swap1" -start_cmd='swapon -a' -stop_cmd=':' +start_cmd="swap1_start" +stop_cmd="swap1_stop" # Add all block-type swap devices; these might be necessary # during disk checks. So, although both have swap1_start and swap1_stop functions, under FreeBSD they're ignored. (I'm presuming when the script was imported from NetBSD it was left intact and the {start,stop}_cmd definitions amended to suit the FreeBSD case.) > To be consistent, one should probably also change the start_cmd to > swap1_start, and fix that function to use swapon -a since its usage of > swapctl is also broken. Then, no_swap and swapoff need to be > defaulted in /etc/defaults/rc.conf. > > Or, one could delete the swap1_{start,stop} functions, and just make > start_cmd be 'swapon -a' and stop_cmd be 'swapoff -a'. > > I don't know which is more better, clearly there's some history here > that's unfinished, or a cross-BSD compatibility thing, or??? Here's my proposed patch: --- netbsd_swap1 2004-09-11 19:25:03.000000000 -0400 +++ freebsd_swap1 2004-09-11 19:34:24.000000000 -0400 @@ -1,17 +1,18 @@ #!/bin/sh # # $NetBSD: swap1,v 1.8 2002/03/24 15:52:41 lukem Exp $ +# $FreeBSD: src/etc/rc.d/swap1,v 1.6 2004/03/08 12:25:05 pjd Exp $ # # PROVIDE: localswap # REQUIRE: disks -# KEYWORD: shutdown +# KEYWORD: FreeBSD nojail shutdown . /etc/rc.subr name="swap1" -start_cmd="swap1_start" -stop_cmd="swap1_stop" +start_cmd='swapon -a' +stop_cmd='swap1_stop' # Add all block-type swap devices; these might be necessary # during disk checks. @@ -29,7 +30,7 @@ { if checkyesno swapoff || [ -n "$rc_force" ]; then echo "Removing block-type swap devices" - swapctl -U -t blk + swapoff -a fi } This leaves the start_cmd the same, rather than using the swap1_start function, because swap1_start checks a "no_swap" setting that doesn't seem to be present on FreeBSD but is on NetBSD. (I don't know if a missing setting defaults to "NO," making this moot.) Changing stop_cmd to use the swap1_stop function makes turning off swap conditional on the "swapoff" setting, instead of unconditional, in the case of setting "stop_cmd='swapoff -a'". So, I think the above patch preserves the current behaviour, unless you set 'swapoff="YES"' in /etc/rc.conf, in which case all swap partitions will be unmounted during shutdown. Cheers, Paul. -- e-mail: paul@gromit.dlib.vt.edu "Without music to decorate it, time is just a bunch of boring production deadlines or dates by which bills must be paid." --- Frank Vincent Zappa