Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Discussed some years ago but never commited: add an option t...



details:   https://anonhg.NetBSD.org/src/rev/adde73564ee7
branches:  trunk
changeset: 433737:adde73564ee7
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 30 10:38:05 2018 +0000

description:
Discussed some years ago but never commited: add an option to have a
single tmpfs (on /tmp) and use that for /var/shm as well (via a symlink
created after the tmpfs on /tmp has been mounted)

diffstat:

 etc/rc.d/cleartmp        |  9 ++++++++-
 share/man/man5/rc.conf.5 |  9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diffs (48 lines):

diff -r 8cff2cd64877 -r adde73564ee7 etc/rc.d/cleartmp
--- a/etc/rc.d/cleartmp Sun Sep 30 10:34:38 2018 +0000
+++ b/etc/rc.d/cleartmp Sun Sep 30 10:38:05 2018 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: cleartmp,v 1.12 2015/07/03 18:36:54 dholland Exp $
+# $NetBSD: cleartmp,v 1.13 2018/09/30 10:38:05 martin Exp $
 #
 
 # PROVIDE: cleartmp
@@ -45,6 +45,13 @@
        (cd ${tmp_dir} &&
            find -x . ! -name . ! -name lost+found ! -name quota.user \
                ! -name quota.group -exec rm -rf -- {} \+ -type d -prune)
+
+       # if requested, create symlink for /var/shm
+       if [ -n "${var_shm_symlink}" ]; then
+               /bin/rm -rf /var/shm
+               /bin/mkdir -m 1777 "${var_shm_symlink}"
+               /bin/ln -s "${var_shm_symlink}" /var/shm
+       fi
 }
 
 load_rc_config $name
diff -r 8cff2cd64877 -r adde73564ee7 share/man/man5/rc.conf.5
--- a/share/man/man5/rc.conf.5  Sun Sep 30 10:34:38 2018 +0000
+++ b/share/man/man5/rc.conf.5  Sun Sep 30 10:38:05 2018 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: rc.conf.5,v 1.174 2018/09/23 09:21:00 maxv Exp $
+.\"    $NetBSD: rc.conf.5,v 1.175 2018/09/30 10:38:05 martin Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -351,6 +351,13 @@
 Boolean value.
 Remove block-type swap devices at shutdown time.
 Useful if swapping onto RAIDframe devices.
+.It Sy var_shm_symlink
+A path.
+If set, names a path that /var/shm will be symlinked to.
+.Pp
+The path needs to live on a tmpfs file system.
+A typical value (assuming /tmp is mounted on tmpfs) would be
+.Pa /tmp/.shm .
 .El
 .Ss Block device subsystems
 .Bl -tag -width net_interfaces



Home | Main Index | Thread Index | Old Index