From root@fh-karlsruhe.de  Wed Oct 20 15:50:46 2004
Return-Path: <root@fh-karlsruhe.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2DD8E16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Oct 2004 15:50:46 +0000 (GMT)
Received: from rz06.fh-karlsruhe.de (rz06.FH-Karlsruhe.DE [193.196.64.6])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0537D43D3F
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Oct 2004 15:50:45 +0000 (GMT)
	(envelope-from root@fh-karlsruhe.de)
Received: from rz-tp600e.fh-karlsruhe.de ([193.196.65.252] helo=localhost)
	by rz06.fh-karlsruhe.de with esmtp (Exim 4.42)
	id 1CKIjX-000UKc-3U; Wed, 20 Oct 2004 17:50:39 +0200
Received: from root by localhost with local (Exim 4.42 (FreeBSD))
	id 1CKIjW-0000Bd-Rs; Wed, 20 Oct 2004 17:50:38 +0200
Message-Id: <E1CKIjW-0000Bd-Rs@localhost>
Date: Wed, 20 Oct 2004 17:50:38 +0200
From: Ralf Wenk <RZ-FreeBSD1004@fh-karlsruhe.de>
Reply-To: Ralf Wenk <RZ-FreeBSD1004@fh-karlsruhe.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Ralf Wenk <RZ-FreeBSD1004@fh-karlsruhe.de>
Subject: Undefined variable used in /etc/rc.d/root
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         72927
>Category:       conf
>Synopsis:       Undefined variable used in /etc/rc.d/root
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    keramida
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 20 16:00:52 GMT 2004
>Closed-Date:    Tue Dec 07 00:54:47 GMT 2004
>Last-Modified:  Tue Dec 07 00:54:47 GMT 2004
>Originator:     Ralf Wenk
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
FH Karlsruhe, University of Applied Sciences
>Environment:
System: FreeBSD 5.3-STABLE FreeBSD 5.3-STABLE #1: Mon Oct 18 13:23:44 CEST 2004 root@RZ-Wenk1:/usr/obj/usr/src/sys/fsc-t-diskless i386


>Description:
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.
	


>Release-Note:
>Audit-Trail:

From: Giorgos Keramidas <keramida@freebsd.org>
To: Ralf Wenk <RZ-FreeBSD1004@fh-karlsruhe.de>
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 <RZ-FreeBSD1004@fh-karlsruhe.de> 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
 %%

From: Ralf Wenk <RZ-FreeBSD1004@fh-karlsruhe.de>
To: Giorgos Keramidas <keramida@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: conf/72927: Undefined variable used in /etc/rc.d/root 
Date: Wed, 20 Oct 2004 18:35:00 +0200

 On 2004-10-20 19:23 +0300, Giorgos Keramidas <keramida@freebsd.org> 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 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?
 
 Yes, it looks OK for me.
 
 Thanks, Ralf
 -- 
 Fachhochschule Karlsruhe  -  Hochschule fuer Technik
 Rechenzentrum / Zentrale Dienste
 http://www.fh-karlsruhe.de/rz/         Moltkestr. 30
 rz-benutzerberatung@fh-karlsruhe.de  76133 Karlsruhe
 Montag bis Freitag 9.00-12.00 Uhr  Fon 0721/925-2305
 
 
State-Changed-From-To: open->patched 
State-Changed-By: keramida 
State-Changed-When: Wed Oct 20 17:01:13 GMT 2004 
State-Changed-Why:  
I've committed a fix to CURRENT.  Thanks :-) 


Responsible-Changed-From-To: freebsd-bugs->keramida 
Responsible-Changed-By: keramida 
Responsible-Changed-When: Wed Oct 20 17:01:13 GMT 2004 
Responsible-Changed-Why:  
When I get approval from RE this will be MFC'ed to RELENG_5. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72927 
State-Changed-From-To: patched->closed 
State-Changed-By: keramida 
State-Changed-When: Tue Dec 7 00:54:24 GMT 2004 
State-Changed-Why:  
This has been merged to RELENG_5 already. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72927 
>Unformatted:
