Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-2794

/etc/init.d/netmount doesn't completely exclude NFS shares

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • current generic_64

      /etc/init.d/netmount states in a comment:

       6 # We skip all NFS shares in this script because they require extra
       7 # daemons to be running on the client in order to work correctly.
       8 # It is best to allow nfs-utils to handle all nfs shares.
      

      Then it carefully excludes nfs and nfs4 mounts with the following code:

      18 start()
      19 {
      20     local x= fs= rc=
      21     for x in $net_fs_list $extra_net_fs_list; do
      22         case "$x" in
      23             nfs|nfs4)
      24             continue
      25             ;;
      26         esac
      27         fs="$fs${fs:+,}$x"
      28     done
      29 
      30     ebegin "Mounting network filesystems"
      31     mount -at $fs
      

      However, immediately after it mounts everything with the '_netdev' option, regardless of whether it is nfs or nfs4:

      33     if [ "$RC_UNAME" = Linux ]; then
      34         mount -a -O _netdev
      35         rc=$?
      36     fi
      

      It is common to include the '_netdev' option for nfs entries in /etc/fstab. 'man mount' states:

      _netdev
                    The  filesystem resides on a device that requires network access
                    (used to prevent the  system  from  attempting  to  mount  these
                    filesystems until the network has been enabled on the system).
      

      So the manpage suggests using the _netdev option, and Funtoo's documentation doesn't warn against it. Although, to be fair, '_netdev' does not appear in the fstab suggestions on http://www.funtoo.org/Nfs

      I think some logic should be inserted into lines 33-36 which excludes nfs and nfs4, even if the _netdev option is found. This seems to be the intent of this script, based on the comment in lines 6-8.

            drobbins drobbins
            hick518 hick518
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: