tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Some powerd(8) defaults



On May 6, 2011, at 7:38 51AM, Jukka Ruohonen wrote:

> Hello.
> 
> Here are some proposed changes to the powerd(8) scripts which I find good
> enough to be enabled by default. Also other suggestions are welcomed.
> 
>  1. Provide a generic "sleep" script and link the current "sleep_button"
>     and "lid_switch" to it appropriately. This means that the default action
>     upon closing the laptop lid changes to "suspend". By default, we already
>     resume (in-kernel) automatically when the lid is opened.

Yes, this is a very good idea.  I've done something like it my self for years,
albeit not in good enough form to commit.
> 
>  2. By default, stop/start the cron(8) deamon upon changes in the AC adapter.
>     This behavior is already in the script, but it was commented out.

As well it should be; not everything cron does should be disabled because
you're on battery.  An interesting question is what the general solution
-- one to permit selective disabling of some entries -- should look like.
> 
>  3. New laptops are notoriously bad at thermal management. Currently NetBSD
>     lacks a well-defined thermal management interface, but the least we could
>     do is to gracefully shutdown the system when "sensor_temperature" is
>     called with "critical" or "critical-over" events. This has saved my
>     ThinkPad many times from the CPU's forceful shutdown detector.
> 
>  4. Before the "low-power" event is called in "sensor_battery", use wall(1)
>     to display a warning during the earlier event. This was requested by
>     jakllsch@ and jmcneill@.

The current set-up is geared towards protecting file system integrity.  I
also care about application integrity, which means that the system needs
to signal -- via SIGPWR? -- applications with enough power left to let them
shut down in an orderly fashion.  In other words, wall(1) is not sufficient.

> 
>  5. Even though NetBSD also lacks an uniform interface to control the
>     display brightness levels, use the acpivga(4)'s sysctls (and possibly
>     other MD sysctls) to set the brightness to, say, 75 % when the AC
>     adapter is disconnected, and set it back to 100 % when the power cord
>     is again plugged.
> 
Hmm -- could we devise such a uniform interface?


                --Steve Bellovin, https://www.cs.columbia.edu/~smb







Home | Main Index | Thread Index | Old Index