Subject: Re: do we need a powerd.conf?
To: None <>
From: Juan RP <>
List: tech-userlevel
Date: 12/13/2007 22:08:38
On Thu, 13 Dec 2007 21:01:30 +0000
"Steven M. Bellovin" <> wrote:

> I wonder if we need a powerd.conf file or some other way to control the
> behavior of the scripts in /etc/powerd/scripts.  I don't agree with all
> of the decisions implicit in that code, and other operating systems do
> permit configurability.  I could always change the code, of course, but
> that strikes me as a poor procedure.
> The case that's bothering me right now is the "shutdown" command in
> sensor_battery.  First, I don't agree with the criteria -- no AC
> adapter and all batteries in critical or low.  I'd use "all batteries
> critical" instead.  (That policy decision appears to be made in kernel
> code, which is even more problematic, though I could presumably change
> envsys.conf to make the "low" and "critical" thresholds about the
> same.)  Second, if there going to be a shutdown it should give a few
> minutes warning, to let the user save files, etc.  Third, in my
> opinion the proper response is to suspend the (laptop) computer, not
> turn it off.  (There's another issue, in that I think the kernel code
> may be buggy, but since the machine powered down so quickly I had no
> chance to understand just what's going on -- maybe it's my BIOS and not
> the NetBSD code, for example.)
> Other examples include deciding what to do when the power button
> means.  Is that power down, hibernate (which we don't support yet, but
> perhaps will some day), or suspend?
> I'm working on some other aspects of these scripts -- I have versions
> of sleep_button and lid_switch that call a .local script, for example
> -- but right now, I'm wondering if we need a more general framework.

That's why they are scripts... if you aren't happy with the shutdown
in the 'low-power' event you can change it.

There's a lot to do to be able to have a general power management
configuration file.

Juan Romero Pardines	- The NetBSD Project	- NetBSD/pkgsrc news in Spanish