From e92e83d4e2e3465bca9ca6d3cc4f746ef6566476 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 11 Mar 2013 22:16:18 -0400 Subject: Add the ability for full installs to optionally use RAM disks for /tmp and /var, and to allow selecting a size for /tmp and /var RAM disks on both Full installs and NanoBSD. I think I caught most of the edge cases for transitioning into and out of RAM disk mode, and preserving data across reboots as is done on NanoBSD (RRD, DHCP leases, pkg/pbi info). --- etc/rc.shutdown | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'etc/rc.shutdown') diff --git a/etc/rc.shutdown b/etc/rc.shutdown index c7e8b25..c63e5e5 100755 --- a/etc/rc.shutdown +++ b/etc/rc.shutdown @@ -25,7 +25,13 @@ export PATH PLATFORM=`cat /etc/platform` if [ "$PLATFORM" = "pfSense" ]; then find -x /tmp/* -type f -exec rm -f {} \; -else +fi + +USE_MFS_TMPVAR=`/usr/bin/grep -c use_mfs_tmpvar /cf/conf/config.xml` +DISK_NAME=`/bin/df /var/db/rrd | /usr/bin/tail -1 | /usr/bin/awk '{print $1;}'` +DISK_TYPE=`/usr/bin/basename ${DISK_NAME} | /usr/bin/cut -c1-2` +# If we are not on a full install, or if the full install wants RAM disks, or if the full install _was_ using RAM disks, but isn't for the next boot... +if [ "${PLATFORM}" != "pfSense" ] || [ ${USE_MFS_TMPVAR} -gt 0 ] || [ "${DISK_TYPE}" = "md" ]; then /etc/rc.backup_rrd.sh /etc/rc.backup_dhcpleases.sh fi -- cgit v1.1