diff --git a/etc/inc/system.inc b/etc/inc/system.inc index ef2884b9cd..c75de773f9 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -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; diff --git a/etc/rc.bootup b/etc/rc.bootup index b19bf4162f..4dda274175 100755 --- a/etc/rc.bootup +++ b/etc/rc.bootup @@ -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 */ diff --git a/usr/local/www/system_advanced_misc.php b/usr/local/www/system_advanced_misc.php index b64985aca6..23722ae86d 100644 --- a/usr/local/www/system_advanced_misc.php +++ b/usr/local/www/system_advanced_misc.php @@ -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");   + + PowerD + + /> +
+ 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. + + + +   + IP Security