rc.d: Add mounttmpfs to support tmpfs at /var/run and /tmp
We are already mounting a tmpfs at /var/run/shm to support shm_open()
etc functions. However, this makes it harder for a user to make
/var/run on a tmpfs. Actually, using a tmpfs for /var/run is a good
idea, though the deamons/system need to create necessary folders, and
Linux has adopted such a model for /run (symlink to /var/run) for years.
Introduce the 'mounttmpfs' rc script to support mounting tmpfs at
/var/run and /tmp, which is enabled by setting 'tmpfs_var_run=YES'
and 'tmpfs_tmp=YES' in /etc/rc.conf, respectively. The default values
for these two new configurations are both 'NO'.
The new 'mounttmpfs' rc script is ordered *after* 'mountcritremote', so
that NFS-mounted /var is also properly handled, although I think
NFS-mounted /var is not a good idea and I don't know anyone really need
to do so.
Also move the tmpfs mounting at /var/run/shm from 'mountcritlocal' to
the new 'mounttmpfs' script.
Reviewed-by: tuxillo