Solved Needless requirement for running bash?

When I install package bash, the following message appears on my teletype:
Code:
 ======================================================================
bash requires fdescfs(5) mounted on /dev/fd
If you have not done it yet, please do the following:
  mount -t fdescfs fdesc /dev/fd
To make it permanent, you need the following lines in /etc/fstab:
  fdesc  /dev/fd  fdescfs  rw  0  0
======================================================================
I go to the man page for fdescfs, and it gives me the following purpose for the existence of fdescfs:
Code:
If the file descriptor is open and the
mode the file is being opened with is a subset of the mode of the exist-
ing descriptor, the call:

fd = open("/dev/fd/0", mode);

and the call:

fd = fcntl(0, F_DUPFD, 0);

are equivalent.
So why does bash bother with this? Why doesn't it just do the fcntl?

I'm sure there's a reason; I just want to know what that reason is, and why I should need to mess with /etc/fstab.
 
When I install package bash, the following message appears on my teletype:
Code:
======================================================================
bash requires fdescfs(5) mounted on /dev/fd
If you have not done it yet, please do the following:
  mount -t fdescfs fdesc /dev/fd
To make it permanent, you need the following lines in /etc/fstab:
  fdesc  /dev/fd  fdescfs  rw  0  0
======================================================================

I just updated my system and got the same message. I am worried about this because the order seems different to other /etc/fstab entries. Shouldn't /dev/fd go first and fdesc go second? I am running 9.3.
 
I am worried about this because the order seems different to other /etc/fstab entries. Shouldn't /dev/fd go first and fdesc go second? I am running 9.3.
No. See fstab(4):
Code:
     [b]The first field, (fs_spec), describes the special device or remote file
     system to be mounted.[/b]  The contents are decoded by the strunvis(3) func-
     tion.  This allows using spaces or tabs in the device name which would be
     interpreted as field separators otherwise.

     [b]The second field, (fs_file), describes the mount point for the file sys-
     tem.[/b]  For swap partitions, this field should be specified as ``none''.
     The contents are decoded by the strunvis(3) function, as above.

The fdesc is the 'special' device (from fdescfs(5)) and /dev/fd is a mount point.

NB. I just spotted an inconsistency in the fdescfs(5) man page:
Code:
SYNOPSIS
     fdescfs /dev/fd fdescfs rw 0 0
This should be
Code:
    fdesc /dev/fd fdescfs rw 0 0
 
While the Bash shell doesn't require fdescfs to be mounted in order to run, Bash is the standard script interpreter for Linux, where that pseudo-filesystem is the norm. Most Bash scripts you come across that gather system information will be written with Linux in mind, and will utilize fdescfs. If it isn't mounted on FreeBSD, the script will fail. So you can use Bash without taking any extra measures, but third-party scripts you run might not work.

As a demonstration, install and run sysutils/screenfetch. It's a Bash script that gathers information about your machine.

EDIT: Fixed a couple confusing typos.
 
Back
Top