diff options
author | jim-p <jimp@pfsense.org> | 2013-03-11 22:16:18 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-03-11 22:16:18 -0400 |
commit | e92e83d4e2e3465bca9ca6d3cc4f746ef6566476 (patch) | |
tree | b72aaf0e1c0b2130b62c28ff7c6ed84076569f64 /etc/rc.shutdown | |
parent | 94ca4e0d47cf61b8e8c812ca3dc18356fc166fb0 (diff) | |
download | pfsense-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.shutdown')
-rwxr-xr-x | etc/rc.shutdown | 8 |
1 files changed, 7 insertions, 1 deletions
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 |