Subject: do we need a powerd.conf?
To: None <>
From: Steven M. Bellovin <>
List: tech-userlevel
Date: 12/13/2007 21:01:30
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.


		--Steve Bellovin,