system: set value on the fly, remove nonexistent tunable

This commit is contained in:
Franco Fichtner 2020-04-29 10:03:31 +02:00
parent 10b4bbfe8d
commit 8933e787f5
3 changed files with 10 additions and 9 deletions

View File

@ -3,11 +3,6 @@
<trigger_initial_wizard/>
<theme>opnsense</theme>
<sysctl>
<item>
<descr><![CDATA[Disable the pf ftp proxy handler.]]></descr>
<tunable>debug.pfftpproxy</tunable>
<value>default</value>
</item>
<item>
<descr><![CDATA[Increase UFS read-ahead speeds to match the state of hard drives and NCQ.]]></descr>
<tunable>vfs.read_max</tunable>

View File

@ -73,7 +73,6 @@ function system_powerd_configure($verbose = false)
function get_default_sysctl_value($id)
{
$sysctls = array(
'debug.pfftpproxy' => '0',
'hw.ibrs_disable' => '0',
'hw.syscons.kbd_reboot' => '0',
'kern.ipc.maxsockbuf' => '4262144',
@ -111,13 +110,20 @@ function get_default_sysctl_value($id)
'net.link.bridge.pfil_onlyip' => '0',
'net.link.tap.user_open' => '1',
'net.local.dgram.maxdgram' => '8192',
'net.pf.request_maxcount' => '5000000',
'net.pf.request_maxcount' => '65535',
'security.bsd.see_other_gids' => '0',
'security.bsd.see_other_uids' => '0',
'vfs.read_max' => '32',
'vm.pmap.pti' => '1',
);
if ($id == 'net.pf.request_maxcount') {
$system = config_read_array('system');
if (!empty($system['maximumtableentries'])) {
$sysctls[$id] = $system['maximumtableentries'];
}
}
if (isset($sysctls[$id])) {
return $sysctls[$id];
}

View File

@ -1306,8 +1306,8 @@ function set_sysctl($values)
$value_list = array();
foreach ($values as $key => $value) {
if ($sysctls != null && !in_array($key, $sysctls)) {
continue;
}
continue;
}
$value_list[] = escapeshellarg($key) . "=" . escapeshellarg($value);
}