Revision e804230c
Added by Brad Davis over 3 years ago
src/etc/pfSense-rc | ||
---|---|---|
461 | 461 |
/bin/rm $varrunpath/booting |
462 | 462 |
fi |
463 | 463 |
|
464 |
if [ "${USE_ZFS}" -eq 1 ]; then |
|
465 |
# Create ZFS reservation |
|
466 |
if [ ! -f /.no_zfs_reservation ]; then |
|
467 |
zfs list -Hp -o name -t filesystem | grep -q pfSense/reservation |
|
468 |
if [ $? -ne 0 ]; then |
|
469 |
AVAIL=$( zfs list -Hpo avail pfSense ) |
|
470 |
RESSIZE=$( zfs list -Hpo avail,used pfSense | awk -v CONVFMT='%.0f' '{printf ( $1 + $2 ) * 0.1 "\n"}' ) |
|
471 |
if [ $(( ${AVAIL} / 2 )) -gt ${RESSIZE} ]; then |
|
472 |
logger "Creating ZFS reservation of ${RESSIZE} bytes" |
|
473 |
zfs create -o reservation=${RESSIZE} pfSense/reservation |
|
474 |
else |
|
475 |
logger "Not enough space to create reservation; ${AVAIL} / 2 is not greater than ${RESSIZE} bytes" |
|
476 |
fi |
|
477 |
fi |
|
478 |
fi |
|
479 |
fi |
|
480 |
|
|
464 | 481 |
echo -n "Starting CRON... " |
465 | 482 |
cd /tmp && /usr/sbin/cron -s 2>/dev/null |
466 | 483 |
echo "done." |
Also available in: Unified diff
Add a ZFS reservation of 10%