Project

General

Profile

« Previous | Next » 

Revision 29aef439

Added by Jim Pingle over 5 years ago

RAM Disk robustness improvements. Fixes NG 3173

  • Prevents RAM disk from being partially enabled and left in a broken
    state if the RAM disks cannot be created
  • Prevents RAM disks from potentially overcommitting free kernel memory,
    which FreeBSD now prevents, but could result in errors.
  • Adds GUI input validation to prevent exceeding free kernel memory when
    sizing RAM disks
  • Ensures the pkg database is always available whether setup for disk
    storage, RAM disks, or if set for RAM disks but they failed to work
  • Moves RAM disk script functions to a common file for reuse.
  • Files a notice to alert the user that RAM disks failed and to check
    the disk sizes
  • Generally makes the RAM disk setup process more verbose on the
    console. These messages can be commented out or removed in the future,
    but are helpful for the time being.

(cherry picked from commit 82bf21fc37ef436f0d8439a84a97d61a7d5979b6)

View differences:

src/etc/pfSense-rc.shutdown
42 42
# Remove temporary files on shutdown from /tmp/
43 43
find -x /tmp/* -type f -exec rm -f {} \; >/dev/null 2>&1
44 44

  
45
USE_MFS_TMPVAR=$(/usr/local/sbin/read_xml_tag.sh boolean system/use_mfs_tmpvar)
46
DISK_NAME=`/bin/df /var/db/rrd | /usr/bin/tail -1 | /usr/bin/awk '{print $1;}'`
47
DISK_TYPE=`/usr/bin/basename ${DISK_NAME} | /usr/bin/cut -c1-2`
48
# 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...
49
if [ "${USE_MFS_TMPVAR}" = "true" ] || [ "${DISK_TYPE}" = "md" ]; then
50
	/etc/rc.backup_aliastables.sh
51
	/etc/rc.backup_rrd.sh
52
	/etc/rc.backup_dhcpleases.sh
53
	/etc/rc.backup_logs.sh
54
fi
45
. /etc/rc.ramdisk_functions.sh
46
ramdisk_make_backup
55 47

  
56 48
# Invoke shutdown scripts if present
57 49
scripts=/usr/local/etc/rc.d/shutdown.*.sh

Also available in: Unified diff