summaryrefslogtreecommitdiffstats
path: root/etc/rc.reboot
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-03-11 22:16:18 -0400
committerjim-p <jimp@pfsense.org>2013-03-11 22:16:18 -0400
commite92e83d4e2e3465bca9ca6d3cc4f746ef6566476 (patch)
treeb72aaf0e1c0b2130b62c28ff7c6ed84076569f64 /etc/rc.reboot
parent94ca4e0d47cf61b8e8c812ca3dc18356fc166fb0 (diff)
downloadpfsense-e92e83d4e2e3465bca9ca6d3cc4f746ef6566476.zip
pfsense-e92e83d4e2e3465bca9ca6d3cc4f746ef6566476.tar.gz
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).
Diffstat (limited to 'etc/rc.reboot')
-rwxr-xr-xetc/rc.reboot8
1 files changed, 7 insertions, 1 deletions
diff --git a/etc/rc.reboot b/etc/rc.reboot
index 4bb28a1..afdc93c 100755
--- a/etc/rc.reboot
+++ b/etc/rc.reboot
@@ -14,7 +14,13 @@ sleep 1
PLATFORM=`cat /etc/platform`
if [ "$PLATFORM" = "pfSense" ]; then
rm -rf /tmp/*
-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
OpenPOWER on IntegriCloud