From owner-freebsd-bugs@FreeBSD.ORG Wed Oct 20 16:30:32 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 09A1416A4D2 for ; Wed, 20 Oct 2004 16:30:32 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCFD743D41 for ; Wed, 20 Oct 2004 16:30:31 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9KGUVhf079660 for ; Wed, 20 Oct 2004 16:30:31 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9KGUVI0079659; Wed, 20 Oct 2004 16:30:31 GMT (envelope-from gnats) Date: Wed, 20 Oct 2004 16:30:31 GMT Message-Id: <200410201630.i9KGUVI0079659@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Giorgos Keramidas Subject: Re: conf/72927: Undefined variable used in /etc/rc.d/root X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Giorgos Keramidas List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2004 16:30:32 -0000 The following reply was made to PR conf/72927; it has been noted by GNATS. From: Giorgos Keramidas To: Ralf Wenk Cc: bug-followup@freebsd.org Subject: Re: conf/72927: Undefined variable used in /etc/rc.d/root Date: Wed, 20 Oct 2004 19:23:23 +0300 On 2004-10-20 17:50, Ralf Wenk wrote: > The root_rw_mount variable which is evaluated in /etc/rc.d/root is, > even in the case of a diskless boot, undefined. This causes a diskless > boot with a read only root filesystem to fail. > > >How-To-Repeat: > Try a diskless boot with readonly root filesystem or search for another > occurence of root_rw_mount in the source other than /usr/src/etc/rc.d/root. > > >Fix: > Until there is a better solution, like the detection of a read only root > filesystem in "the right place", add root_rw_mount="YES" to /etc/rc.conf. How about setting this in /etc/defaults/rc.conf to "YES" and documenting it in rc.conf(5) for people using a diskless setup? Does the following look ok to you? %% Index: etc/defaults/rc.conf =================================================================== RCS file: /home/ncvs/src/etc/defaults/rc.conf,v retrieving revision 1.225 diff -u -u -r1.225 rc.conf --- etc/defaults/rc.conf 13 Oct 2004 07:12:14 -0000 1.225 +++ etc/defaults/rc.conf 20 Oct 2004 16:13:29 -0000 @@ -55,6 +55,7 @@ gbde_swap_enable="NO" # Set to YES to automatically initialize gbde swap # devices listed in fstab with a random one-shot key +root_rw_mount="YES" # Set to NO to inhibit remounting root read-write. fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails. background_fsck="YES" # Attempt to run fsck in the background where possible. background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. Index: share/man/man5/rc.conf.5 =================================================================== RCS file: /home/ncvs/src/share/man/man5/rc.conf.5,v retrieving revision 1.228 diff -u -u -r1.228 rc.conf.5 --- share/man/man5/rc.conf.5 17 Oct 2004 13:19:10 -0000 1.228 +++ share/man/man5/rc.conf.5 20 Oct 2004 16:19:51 -0000 @@ -1093,6 +1093,17 @@ .Pa /etc/fstab will be initialized with a random, one-shot key. Note that this makes recovery of kernel dumps impossible. +.It Va root_rw_mount +.Pq Vt bool +If set to +.Dq Li YES , +the root file system is remounted as read-write after the filesystems +are checked. +Diskless systems that mount their filesystem from a read-only remote +NFS share should set this to +.Dq Li NO +in their +.Pa rc.conf . .It Va fsck_y_enable .Pq Vt bool If set to %%