Commit Graph

20 Commits

Author SHA1 Message Date
xtraeme cee3aed721 Also log the 'low-power' event via logger -p warning to have records
of what happened.
2007-10-11 19:47:26 +00:00
xtraeme b8ef2c3d1f Fix a typo in previous. 2007-10-11 00:30:47 +00:00
xtraeme d6753145c8 Use consistenly more meaningful messages in all envsys scripts. 2007-10-11 00:11:24 +00:00
xtraeme 7ade6d03ad Fix the problems described in:
http://mail-index.netbsd.org/current-users/2007/07/16/0012.html

- Introduce sme_class into the sysmon_envsys struct to specify a
  class; currently there are two classes: SME_CLASS_ACADAPTER and
  SME_CLASS_BATTERY.

- Add a new envsys event: PENVSYS_EVENT_LOW_POWER that is reached when
  all SME_CLASS_BATTERY devices are in CRITICAL/LOW state and there's not
  any SME_CLASS_ACADAPTER connected.

- Add the 'low-power' event into the sensor_battery script that will
  shutdown the system gracefully via 'shutdown -p'. If powerd(8) is
  not running, cpu_reboot(9) with RB_POWERDOWN is used.

- Make acpiacad(4) a SME_CLASS_ACADAPTER device and acpibat(4) a
  SME_CLASS_BATTERY device.

Update the documentation accordingly to these changes.
2007-10-10 23:25:39 +00:00
xtraeme 29742be0c4 Only three events are reported now:
normal
	state-changed
	user-capacity

But there's a fourth argument passed to the script that will report
current state description.
2007-09-04 16:59:49 +00:00
xtraeme e8d5f35d1f Do not shutdown the system when a critical event is received, this
doesn't work when there are two or more batteries in acpibat(4).
2007-07-17 13:56:25 +00:00
xtraeme 8a3fc18201 This one is shared for Indicators and Integers... update the comment. 2007-07-16 17:51:09 +00:00
xtraeme e9878e8efb Add the /etc/powerd/scripts/sensor_indicator to handle events on
indicator sensors.

Update powerd(8).
2007-07-02 15:26:18 +00:00
xtraeme 08d5afa292 Imported envsys 2, a brief description of the new features:
(Part 4: documentation and configuration files)

* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
  and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
  sysmon_power(9) and powerd(8), that means there is no 32 bytes event
  size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.

Tested by:

blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 07:55:51 +00:00
jnemeth 38322a9a53 fix a couple of comments 2006-09-27 01:41:45 +00:00
jmcneill 788671871d Install all example powerd scripts by default. 2006-09-26 02:18:16 +00:00
jmcneill d54c2134a8 Add useful example scripts for powerd acadapter, lid_switch, and
sleep_button events. These use the /dev/apm interface, so should be useful
on more than just i386.
2006-09-26 02:17:38 +00:00
lukem ee04d88971 Consistently use CONFIGFILES & CONFIGLINKS (which enable the 'configinstall'
target) instead of using home-grown 'distribution' targets or using
FILES with the 'install' target.
Add some etc/ subdir Makefiles where appropriate.

XXX: some of etc/Makefile install-etc-files could be converted to CONFIGFILES.
2004-05-16 09:53:09 +00:00
lukem 6a7c1e3169 improve comment 2003-12-08 08:12:01 +00:00
mycroft 6f4bc2c877 Announce a reason for the shutdown. 2003-11-01 23:04:54 +00:00
mycroft adfa67a197 Oops, fix comments. 2003-10-30 17:42:23 +00:00
mycroft 87c704cac0 Add dummy scripts for these events. 2003-10-30 17:34:45 +00:00
mycroft 1455475ac4 Use logger(1) to log errors -- otherwise the output goes nowhere. 2003-10-30 17:32:45 +00:00
thorpej 953de79cde Add a reset_button script. 2003-04-20 20:55:39 +00:00
thorpej e45c396415 Add a default power_button script for powerd(8). 2003-04-18 05:40:06 +00:00