mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Adding PowerD knob to system -> advanced -> misc. This will be useful
for folks wishing for their firewall to use less power overall. Blurb
from the powerd man page from freebsd:
The powerd utility monitors the system state and sets various power con-
trol options accordingly. It offers three modes (maximum, minimum, and
adaptive) that can be individually selected while on AC power or batter-
ies. The modes maximum, minimum, and adaptive may be abbreviated max,
min, adp.
Maximum mode chooses the highest performance values. Minimum mode
selects the lowest performance values to get the most power savings.
Adaptive mode attempts to strike a balance by degrading performance when
the system appears idle and increasing it when the system is busy. It
offers a good balance between a small performance loss for greatly
increased power savings. The default mode is adaptive.
This commit is contained in:
parent
37c7bad815
commit
8e9fa41d89
@ -32,6 +32,15 @@
|
||||
/* include all configuration functions */
|
||||
require_once("functions.inc");
|
||||
|
||||
function activate_powerd() {
|
||||
global $config, $g;
|
||||
if(isset($config['system']['powerd_enable'])) {
|
||||
exec("/usr/sbin/powerd -b adp -a adp");
|
||||
} else {
|
||||
exec("/usr/bin/killall powerd");
|
||||
}
|
||||
}
|
||||
|
||||
function activate_sysctls() {
|
||||
global $config, $g;
|
||||
|
||||
|
||||
@ -280,6 +280,9 @@
|
||||
/* start the upnp daemon if it is enabled */
|
||||
upnp_start();
|
||||
|
||||
/* If powerd is enabled, lets launch it */
|
||||
activate_powerd();
|
||||
|
||||
mwexec_bg("/usr/sbin/update_dns_cache.sh");
|
||||
|
||||
/* done */
|
||||
|
||||
@ -46,6 +46,7 @@ require("guiconfig.inc");
|
||||
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
|
||||
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
|
||||
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
|
||||
$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
|
||||
|
||||
if ($_POST) {
|
||||
|
||||
@ -69,6 +70,7 @@ if ($_POST) {
|
||||
unset($config['system']['lb_use_sticky']);
|
||||
|
||||
$config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
|
||||
$config['system']['powerd_enable'] = $_POST['powerd_enable'] ? true : false;
|
||||
|
||||
write_config();
|
||||
|
||||
@ -80,6 +82,8 @@ if ($_POST) {
|
||||
else
|
||||
$savemsg = $retval;
|
||||
config_unlock();
|
||||
|
||||
activate_powerd();
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,6 +148,26 @@ include("head.inc");
|
||||
<tr>
|
||||
<td colspan="2" class="list" height="12"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="22%" valign="top" class="vncell">PowerD</td>
|
||||
<td width="78%" class="vtable">
|
||||
<input name="powerd_enable" type="checkbox" id="powerd_enable" value="yes" <?php if ($pconfig['powerd_enable']) echo "checked"; ?> />
|
||||
<br />
|
||||
The powerd utility monitors the system state and sets various power con-
|
||||
trol options accordingly. It offers three modes (maximum, minimum, and
|
||||
adaptive) that can be individually selected while on AC power or batter-
|
||||
ies. The modes maximum, minimum, and adaptive may be abbreviated max,
|
||||
min, adp. Maximum mode chooses the highest performance values. Minimum
|
||||
mode selects the lowest performance values to get the most power savings.
|
||||
Adaptive mode attempts to strike a balance by degrading performance when
|
||||
the system appears idle and increasing it when the system is busy. It
|
||||
offers a good balance between a small performance loss for greatly
|
||||
increased power savings. The default mode for pfSense is adaptive.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="list" height="12"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" valign="top" class="listtopic">IP Security</td>
|
||||
</tr>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user