git: rc.d: Add mounttmpfs to support tmpfs at /var/run and /tmp
aly at crater.dragonflybsd.org
Wed Apr 29 06:32:35 PDT 2020
Author: Aaron LI <aly at aaronly.me>
Date: Wed Apr 29 12:47:23 2020 +0800
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.
Summary of changes:
etc/defaults/rc.conf | 4 +++-
etc/rc.d/Makefile | 3 ++-
etc/rc.d/SERVERS | 4 ++--
etc/rc.d/mountcritlocal | 5 -----
etc/rc.d/mounttmpfs | 37 +++++++++++++++++++++++++++++++++++++
share/man/man5/rc.conf.5 | 19 ++++++++++++++++++-
6 files changed, 62 insertions(+), 10 deletions(-)
create mode 100644 etc/rc.d/mounttmpfs
DragonFly BSD source repository
More information about the Commits