apmd is an monitoring daemon for the Advanced Power Management (APM) subsystem. It works in conjunction with the APM BIOS driver in the OS kernel. apmd manages events shown by the Power management BIOS driver, a driver reports on battery level and requests to enter sleep or suspend mode. apmd will register all reports it gets via syslogd and take steps to ensure that basic sleep and suspend calls are handled perfectly. apmd emits various messages, most of which are self-explanatory.

Synopsis :
apmd [ -TVWciqv ] [ -P program ] [ -T seconds ] [ -c seconds] [ -p percent ] [ -v level] [ -w percent]
OPTIONS :
| Tag | Explanation |
|---|---|
| -P [program],–proxy program | Directs the proxy program to execute when events are received. |
| -V,–version | It prints the version of the apmd program and exits. |
| -T [seconds] ,–proxy-timeout [seconds] | It sets a definite timeout for the proxy.If this option is not given or is given with a negative argument, apmd waits indefinitely for the proxy to finish.The default timeout is of 30 seconds. |
| -c [seconds] ,–check [seconds] | It controls how much time to wait for an event to occur.Controls how many seconds to block on the /dev/apm_bios device. Normally the daemon blocks until the APM driver reports an event.The default is 30 seconds. |
| -p [percent],–percentage percent | It logs the information of percentage of power changes(discharge or recharge).The default is 5. A value greater than 100 can be imposed to disable periodic logging of the battery level. |
| -q,–quiet-bios-battery-low | Directs apmd not to generate a warning when a LOW BATTERY signal is received from the APM subsystem. |
| -w percent,–warn percent | When the battery is not being charged and the percentage of available power drops below warn_percent, log a warning at ALERT level to syslog(2). If the -W or –wall flag was given, the daemon will also use wall(1) to alert all users of impending doom. Give the warning each time the percentage changes. The default is 10. Use negative values to disable this feature. |
| -v [level] ,–verbose [level] | Enables verbose mode, where each event reported by the APM driver is logged. |
| -W,–wall | In addition to logging low battery status (as determined either by the -w level or by the APM BIOS) using syslog(2), apmd will, given this option, also use wall(1) to alert all users. |
| -h,–help | Prints a command summary and exits. |
The power management and conservation activities are mainly handled by the proxy program specified using the -P option. The proxy program is invoked with one or two arguments:
- start-Invoked when the daemon starts.
- stop-Invoked when the daemon stops.
- standby [ system | user ]-Invoked when the APM driver reports that system standby has been initiated. The second parameter indicates whether the BIOS or a user action caused this.
- suspend [ system | user ]-Invoked when the APM driver reports that system suspension has been initiated. The second parameter indicates whether the BIOS or a user action (ex-closing a machine) initiated suspension.
- resume [ suspend | standby | critical ]-Invoked when the APM driver reports that system has resumed normal operation. The second parameter indicates what sort of mode it was in before, either the “suspend” mode or else “standby” mode.
- change power-Invoked when the APM subsystem reports a change in power status, such as a switch from mains to battery power.
- change battery-The APM driver has reported that the BIOS thinks the strength of one (or more) batteries is “low” and at least five minutes of power should remain.
- change capability-Some change in the power management capabilities of the system was reported, maybe by operation of some setup utility, or by the arrival or removal of some devices.
BUGS :
- The values showed maybe vary with actual charge and discharge rates and times can be very inaccurate.
- The daemon supports all APM events described in the APM BIOS specification version 1.2 but it fails to support some of the advanced features of APM 1.2.
- Multiple batteries are treated as if they are one single large one.
FILES :
- /dev/apm_bios
- /etc/apm/apmd_proxy
- /proc/apm
- /etc/apmd_proxy