Date: Wed, 4 Jun 2003 22:39:01 -0400 From: The Anarcat <anarcat@anarcat.ath.cx> To: FreeBSD-gnats-submit@FreeBSD.org Subject: conf/52959: rcNG ignores non-nfs network mounts Message-ID: <20030605023859.0EC2C3C2@shall.anarcat.ath.cx> Resent-Message-ID: <200306050240.h552eFVx071195@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 52959 >Category: conf >Synopsis: rcNG ignores non-nfs network mounts >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 04 19:40:15 PDT 2003 >Closed-Date: >Last-Modified: >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: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030605023859.0EC2C3C2>