Commit Graph

41 Commits

Author SHA1 Message Date
roy 1541a8a5a7 Remove the stopping and starting of various network scripts on
sleep / resume.
This should no longer be needed now the various applications
(dhcpcd, ntpd, wpa_supplicant et all) are more aware to the network state
as all interface carriers should be brought down and up again.

Fixes PR misc/52397.
2017-07-13 13:50:48 +00:00
christos 0ad077175a Add some states not handled before. XXX: are both states in the | cases
possible?
2014-03-13 00:50:55 +00:00
pgoyette 9f498223f2 Handle any reports of state changes for INDICATORs 2012-08-27 21:50:19 +00:00
jruoho 23fb23b458 Gracefully shutdown upon reaching critical temperature levels. Prevents few
laptops (ThinkPad T61 and x61s, among others) from hitting the in-CPU reset.
2012-04-10 13:58:52 +00:00
jmcneill 3ed028dc67 restart dhcpcd if we get a "released" event from the vmt0 driver 2011-10-17 23:27:41 +00:00
jym 256df2d4a9 - use -q to test for presence of a sysctl(7) variable silently
- modify powerd(8) sleep_button script so it can handle the soon-to-be
Xen suspend command.
2011-09-17 14:44:18 +00:00
plunky b52bb12959 provide a new 'bluetooth' rc.d script, to handle Bluetooth configuration
in a simpler manner. This replaces btattach, btconfig, bthcid, btdevctl
and sdpd scripts, and also should not require any configuration settings
other than "bluetooth=YES", though the full range of configurations is
still possible.
2011-05-27 09:28:41 +00:00
jruoho 7373892abb Use hw.acpi.sleep.state instead of machdep.sleep_state. 2010-12-31 09:36:15 +00:00
jruoho e26a5e9d52 Remove the apm(8) example. Instead point to the sleep_button -script. 2010-12-31 09:33:10 +00:00
jruoho d6f07c40ce Remove the sony(4) and piixpcib(4) based actions; all powerd(8) scripts
should either be machine-independent or provide hints for the user. Also
clean the script a little.
2010-12-31 09:29:43 +00:00
macallan 3f7245fde9 adapt to how backlight control is supposed to work - just flip the switch and
we don't need to save the brightness level
2010-10-28 02:06:02 +00:00
abs 54e08a2860 use '/etc/rc.d/apmd onestatus' rather than '/etc/rc.d/apmd status',
so we DTRT if apmd is set to NO in rc.conf
2010-09-19 21:47:28 +00:00
macallan 0b888e557e save backlight level and turn it off on lid close, restore on lid open 2010-09-14 04:37:04 +00:00
pgoyette 82c7774043 Add cases for new {high,maximum}-capacity events 2010-02-15 22:56:13 +00:00
pgoyette fdcbe744db Long-overdue update. Need to handle both {warning,critical}-capacity
events.
2009-06-13 15:35:10 +00:00
pgoyette 09cc50c97b Enclose the ifconfig commands in $(...) so they actually do something.
Reported on current-users by Pierre Pronchery <khorben at defora dot org>
2008-08-22 11:18:21 +00:00
jmcneill 0814e53527 Don't try to standby on a lid_switch pressed event, this has a few problems:
1. ACPI S1 doesn't work properly for many people on NetBSD
  2. It prevents someone from using their laptop with an external display
2008-06-20 02:38:00 +00:00
jmcneill e0099699ff Stop and start bluetooth services across suspend. 2008-06-06 23:13:58 +00:00
jmcneill 1cba716bb9 If machdep.sleep_state is present, use it in favour of apm. Also stop and
start wpa_supplicant across suspend/resume just to be safe.
2008-05-21 13:06:10 +00:00
christos 3e0495561a try to use programs from base (from anon ymous) sudo -> su 2008-01-17 00:37:46 +00:00
jmcneill 1247e31569 Add example hotkey_button script 2007-12-22 19:04:10 +00:00
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