From anarcat@anarcat.ath.cx  Wed Jun  4 19:39:13 2003
Return-Path: <anarcat@anarcat.ath.cx>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 23ECE37B404
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 Jun 2003 19:39:13 -0700 (PDT)
Received: from aeimail.aei.ca (aeimail.aei.ca [206.123.6.14])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 24D0C43FBD
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 Jun 2003 19:39:12 -0700 (PDT)
	(envelope-from anarcat@anarcat.ath.cx)
Received: from shall.anarcat.ath.cx (oczvd3jc1kxjh2e3@dsl-133-253.aei.ca [66.36.133.253])
	by aeimail.aei.ca (8.11.6/8.10.1) with ESMTP id h552d8g08509
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 4 Jun 2003 22:39:09 -0400 (EDT)
Received: from lenny.anarcat.ath.cx (lenny.anarcat.ath.cx [192.168.0.4])
	by shall.anarcat.ath.cx (Postfix) with SMTP
	id 0EC2C3C2; Wed,  4 Jun 2003 22:38:59 -0400 (EDT)
Received: by lenny.anarcat.ath.cx (sSMTP sendmail emulation); Wed, 4 Jun 2003 22:39:01 -0400
Message-Id: <20030605023859.0EC2C3C2@shall.anarcat.ath.cx>
Date: Wed, 4 Jun 2003 22:39:01 -0400
From: The Anarcat <anarcat@anarcat.ath.cx>
Reply-To: The Anarcat <anarcat@anarcat.ath.cx>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: rcNG ignores non-nfs network mounts
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52959
>Category:       conf
>Synopsis:       rcNG ignores non-nfs network mounts
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    gordon
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 04 19:40:15 PDT 2003
>Closed-Date:    Sat Jun 07 12:25:54 PDT 2003
>Last-Modified:  Sat Jun 07 12:25:54 PDT 2003
>Originator:     The Anarcat
>Release:        FreeBSD 5.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD lenny.anarcat.ath.cx 5.1-RELEASE FreeBSD 5.1-RELEASE #4: Wed Jun 4 10:34:08 EDT 2003 anarcat@lenny.anarcat.ath.cx:/usr/obj/usr/src/sys/LENNII i386


	
>Description:

For some time now, the samba shares are mounted by default, or at
least possible to mount automatically using the extra_netfs_types
toggle in rc.conf.

Under rcNG, this doesn't work anymore. A samba share specified in
/etc/fstab isn't mounted along with the NFS fs, even if an
extra_netfs_types line is in /etc/rc.conf.

I feel I'm too late for 5.1 now, since the tag seems to have been
layed down, and that's why I'm logging this to GNATS. :)

>How-To-Repeat:

In /etc/fstab:

//myshares/share	/mnt	smbfs	ro,-N,noexec	0	0

With or without:

extra_netfs_types="smbfs:SMB"

doesn't mount the share at boot.

>Fix:

Hack:

--- mountcritremote.orig	Wed Jun  4 18:48:31 2003
+++ mountcritremote	Wed Jun  4 22:22:06 2003
@@ -55,6 +55,17 @@
 		mount -a -t nfs
 		echo '.'
 
+                # Set up the list of network filesystem types for which mounting
+                # should be delayed until after network initialization.
+                networkfs_types='nfs:NFS smbfs:SMB portalfs:PORTAL'
+                case ${extra_netfs_types} in
+                [Nn][Oo])
+                        ;;
+                *)
+                        networkfs_types="${networkfs_types} ${extra_netfs_types}"
+                        ;;
+                esac
+
 		# Mount other network filesystems if present in /etc/fstab.
 		for i in ${networkfs_types}; do
 			fstype=${i%:*}

Those inserted lines should be put in some common file in the rcNG
framework, but I don't know it enough to choose.

An alternative, maybe cleaner solution could be:

--- etc/rc.d/mountcritlocal.orig	Wed Jun  4 22:29:33 2003
+++ etc/rc.d/mountcritlocal	Wed Jun  4 22:28:53 2003
@@ -18,20 +18,9 @@
 {
 	case ${OSTYPE} in
 	FreeBSD)
-		# Set up the list of network filesystem types for which mounting
-		# should be delayed until after network initialization.
-		networkfs_types='nfs:NFS smbfs:SMB portalfs:PORTAL'
-		case ${extra_netfs_types} in
-		[Nn][Oo])
-			;;
-		*)
-			networkfs_types="${networkfs_types} ${extra_netfs_types}"
-			;;
-		esac
-
 		# Mount everything except nfs filesystems.
 		mount_excludes='no'
-		for i in ${networkfs_types}; do
+		for i in ${networkfs_types} ${extra_netfs_types}; do
 			fstype=${i%:*}
 			mount_excludes="${mount_excludes}${fstype},"
 		done
--- etc/rc.d/mountcritremote.orig	Wed Jun  4 22:27:34 2003
+++ etc/rc.d/mountcritremote	Wed Jun  4 22:27:01 2003
@@ -56,7 +56,7 @@
 		echo '.'
 
 		# Mount other network filesystems if present in /etc/fstab.
-		for i in ${networkfs_types}; do
+		for i in ${networkfs_types} ${extra_netfs_types}; do
 			fstype=${i%:*}
 			fsdecr=${i#*:}
 
--- /usr/src/etc/defaults/rc.conf	Fri May  2 01:27:34 2003
+++ etc/defaults/rc.conf	Wed Jun  4 22:34:40 2003
@@ -44,8 +44,10 @@
 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.
-extra_netfs_types="NO"	# List of network extra filesystem types for delayed
-			# mount at startup (or NO).
+networkfs_types='nfs:NFS smbfs:SMB portalfs:PORTAL' # network filesystems
+			# NOTE: mount delayed after network initialization
+extra_netfs_types=""	# List of network extra filesystem types for delayed
+			# mount at startup (or "").
 
 ##############################################################
 ###  Network configuration sub-section  ######################

But I feel this last one is going to create an uproar of bikeshed wars
for the untraditionnal use of a rc.conf toggle ("" instead of
NO). Also, it's pretty pointless to have extra_netfs_types if you can
hack networkfs_types... :)

The problem here is that I don't want to duplicate code between
mountcritremote and mountcritlocal, any ideas?
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gordon 
Responsible-Changed-By: mtm 
Responsible-Changed-When: Sat Jun 7 03:38:17 PDT 2003 
Responsible-Changed-Why:  
Gordon, 
I think you were working in this area recently. Can you look at this 
PR? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52959 
State-Changed-From-To: open->closed 
State-Changed-By: gordon 
State-Changed-When: Sat Jun 7 12:24:31 PDT 2003 
State-Changed-Why:  
I committed a modified fix on June 1. Thanks! 

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