Module Name: src Committed By: martin Date: Sun Sep 30 10:38:05 UTC 2018
Modified Files: src/etc/rc.d: cleartmp src/share/man/man5: rc.conf.5 Log Message: 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) To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/etc/rc.d/cleartmp cvs rdiff -u -r1.174 -r1.175 src/share/man/man5/rc.conf.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/etc/rc.d/cleartmp diff -u src/etc/rc.d/cleartmp:1.12 src/etc/rc.d/cleartmp:1.13 --- src/etc/rc.d/cleartmp:1.12 Fri Jul 3 18:36:54 2015 +++ src/etc/rc.d/cleartmp Sun Sep 30 10:38:05 2018 @@ -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 @@ cleartmp_start() (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 Index: src/share/man/man5/rc.conf.5 diff -u src/share/man/man5/rc.conf.5:1.174 src/share/man/man5/rc.conf.5:1.175 --- src/share/man/man5/rc.conf.5:1.174 Sun Sep 23 09:21:00 2018 +++ src/share/man/man5/rc.conf.5 Sun Sep 30 10:38:05 2018 @@ -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 @@ Defaults to false. 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