Commit 4b9a265f authored by Franco Fichtner's avatar Franco Fichtner

system: /var and /tmp MFS migrate to tmpfs; #243

Remove the size settings for those mount points as a preparation,
because tmpfs does not need an upper bound.  Hardcode everything
now, replace mfs with tmpfs in an upcoming commit.
parent 84a54198
......@@ -124,20 +124,6 @@ fi
USE_MFS_TMPVAR=`/usr/bin/grep -c use_mfs_tmpvar /conf/config.xml`
if [ ${USE_MFS_TMPVAR} -ne 0 ]; then
USE_MFS_TMP_SIZE=`/usr/bin/grep use_mfs_tmp_size /conf/config.xml | /usr/bin/cut -f2 -d'>' | /usr/bin/cut -f1 -d'<'`
if [ ! -z ${USE_MFS_TMP_SIZE} ] && [ ${USE_MFS_TMP_SIZE} -gt 0 ]; then
tmpsize="${USE_MFS_TMP_SIZE}m"
else
tmpsize="40m"
fi
USE_MFS_VAR_SIZE=`/usr/bin/grep use_mfs_var_size /conf/config.xml | /usr/bin/cut -f2 -d'>' | /usr/bin/cut -f1 -d'<'`
if [ ! -z ${USE_MFS_VAR_SIZE} ] && [ ${USE_MFS_VAR_SIZE} -gt 0 ]; then
varsize="${USE_MFS_VAR_SIZE}m"
else
varsize="60m"
fi
echo -n "Setting up memory disks..."
if [ ! -d /root/var/db/pkg ]; then
......@@ -148,8 +134,8 @@ if [ ${USE_MFS_TMPVAR} -ne 0 ]; then
ln -s /root/var/db/pkg /var/db/pkg
fi
mdmfs -S -M -s ${tmpsize} md /tmp
mdmfs -S -M -s ${varsize} md /var
mdmfs -S -M -s 40m md /tmp
mdmfs -S -M -s 60m md /var
mkdir -p /var/db
ln -s /root/var/db/pkg /var/db/pkg
......
......@@ -50,8 +50,6 @@ $pconfig['schedule_states'] = isset($config['system']['schedule_states']);
$pconfig['kill_states'] = isset($config['system']['kill_states']);
$pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']);
$pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);
$pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size'];
$pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size'];
$pconfig['powerd_ac_mode'] = "hadp";
if (!empty($config['system']['powerd_ac_mode'])) {
......@@ -84,14 +82,6 @@ if ($_POST) {
$input_errors[] = gettext("Please select a valid Thermal Hardware Sensor.");
}
if (!empty($_POST['use_mfs_tmp_size']) && (!is_numeric($_POST['use_mfs_tmp_size']) || ($_POST['use_mfs_tmp_size'] <= 40))) {
$input_errors[] = gettext("/tmp Size must be numeric and should not be less than 40MB.");
}
if (!empty($_POST['use_mfs_var_size']) && (!is_numeric($_POST['use_mfs_var_size']) || ($_POST['use_mfs_var_size'] <= 60))) {
$input_errors[] = gettext("/var Size must be numeric and should not be less than 60MB.");
}
if (!$input_errors) {
if ($_POST['harddiskstandby'] <> "") {
$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
......@@ -189,9 +179,6 @@ if ($_POST) {
unset($config['system']['use_mfs_tmpvar']);
}
$config['system']['use_mfs_tmp_size'] = $_POST['use_mfs_tmp_size'];
$config['system']['use_mfs_var_size'] = $_POST['use_mfs_var_size'];
if (isset($_POST['rrdbackup'])) {
$config['system']['rrdbackup'] = $_POST['rrdbackup'];
install_cron_job("/usr/local/etc/rc.backup_rrd", ($config['system']['rrdbackup'] > 0), $minute = "0", "*/{$config['system']['rrdbackup']}");
......@@ -240,15 +227,11 @@ include("head.inc");
}
function tmpvar_checked(obj) {
if (obj.checked) {
jQuery('#use_mfs_tmp_size').attr('disabled',false);
jQuery('#use_mfs_var_size').attr('disabled',false);
jQuery('#rrdbackup').attr('disabled',false);
jQuery('#dhcpbackup').attr('disabled',false);
jQuery('#rrdbackup').selectpicker('refresh');
jQuery('#dhcpbackup').selectpicker('refresh');
} else {
jQuery('#use_mfs_tmp_size').attr('disabled','true');
jQuery('#use_mfs_var_size').attr('disabled','true');
jQuery('#rrdbackup').attr('disabled','true');
jQuery('#dhcpbackup').attr('disabled','true');
jQuery('#rrdbackup').selectpicker('refresh');
......@@ -549,32 +532,6 @@ endforeach; ?>
"rather than use the hard disk. Setting this will cause the data in /tmp and /var to be lost at reboot, including log data. RRD and DHCP Leases will be retained."); ?>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("/tmp RAM Disk Size"); ?></td>
<td width="78%" class="vtable">
<input name="use_mfs_tmp_size" id="use_mfs_tmp_size" type="text" value="<?php if ($pconfig['use_mfs_tmp_size'] <> "") {
echo $pconfig['use_mfs_tmp_size'];
} ?>" class="formfld unknown" <?php if ($pconfig['use_mfs_tmpvar'] == false) {
echo "disabled=\"disabled\"";
} ?> /> MB
<br />
<?=gettext("Set the size, in MB, for the /tmp RAM disk. " .
"Leave blank for 40MB. Do not set lower than 40."); ?>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("/var RAM Disk Size"); ?></td>
<td width="78%" class="vtable">
<input name="use_mfs_var_size" id="use_mfs_var_size" type="text" value="<?php if ($pconfig['use_mfs_var_size'] <> "") {
echo $pconfig['use_mfs_var_size'];
} ?>" class="formfld unknown" <?php if ($pconfig['use_mfs_tmpvar'] == false) {
echo "disabled=\"disabled\"";
} ?> /> MB
<br />
<?=gettext("Set the size, in MB, for the /var RAM disk. " .
"Leave blank for 60MB. Do not set lower than 60."); ?>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Periodic RRD Backup");?></td>
<td width="78%" class="vtable">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment