Subject: Re: reboot due to critical battery level
To: Steven M.Bellovin <smb@cs.columbia.edu>
From: Jared D. McNeill <jmcneill@invisible.ca>
List: tech-kern
Date: 12/20/2007 14:10:08
On 20-Dec-07, at 1:34 PM, Steven M. Bellovin wrote:
> You need *some* power for suspend.  It's also why I do a sync in
> the suspend process, though I believe the current ACPI code does
> that automatically.  The problem that shutdown loses application
> data.  If I'm editing a file, I want time to save it.  In other
> words, while clean shutdowns of file systems are important, clean
> shutdowns of applications are important, too.  (The shutdown command
> in powerd/scripts/sensor_battery *really* needs to do a 'shutdown
> +5' instead of a 'shutdown now'.  However, it probably needs an &
> after it, since it appears from other interactions -- I haven't
> checked this thoroughly -- that powerd blocks waiting for scripts
> to finish.  There also needs to be an easy way to cancel the
> shutdown.  Often, for example, I'm working in a comfortable chair
> and don't want to bother dragging out the power adapter.  When I
> get the "your battery is really, really low" warning, I either
> suspend and move to my office or I do go to the trouble of finding
> the power cord...    Either way, I need to cancel the shutdown.)

Again, I suggest you actually look at powerd and pmf. You get ample  
warning before we force a shutdown, plenty of time to notify yourself  
before it reaches critical state.

If you're cooking in the kitchen, and you feel heat, do you move your  
hand away when it feels warm or when it is on fire?

Jared