SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from PLD apmd-3.0.2-12.i586.rpm

APMD

Section: Linux Programmer's Manual (8)
Updated: 10 Jun 1999
Index 

NAME

apmd - Advanced Power Management (APM) daemon 

SYNOPSIS

apmd[ -c check_seconds ][ -P proxy_cmd ][ -p percent_to_log ][ -qVvW ][ -w warn_percent ][ -? ][deprecated options] 

DESCRIPTION

apmdis an APM monitoring daemon, and works in conjunction with theAPM BIOS driver in the OS kernel. It can execute a command (normally a shellscript) when certain events are reported by the driver, and will log, viasyslogd(8),certain changes in system power status. When the available battery power becomesvery low, it can alert all users on the system using several methods.

When the kernel APM driver notifies the daemon ofa pending suspend or standby request,apmdwill invoke the approprate command,log the event, sync(2)data to the disk,sleep briefly to help ensure all the data actually gets to the disk,and then tell the APM driver to continue its operation.However, for "critical" suspends (indicating an emergency shutdown)only the last step (telling the driver to continue) is performed.

Most uses of this daemon will use theproxycommand to support power conservation activities. This command iseither specified using the -P option, or/etc/apm/apmd_proxyby default. It is invoked with one or two arguments:

start
Invoked when the daemon starts. Normally sets system-wide power policy, such asIDE hard drive standby times, to account for whether battery power is in use.
stop
Invoked when the daemon stops. Normally undoes any policy settings done when thedaemon started.
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 (such as closinga laptop) initiated suspension.

The BIOS "suspend" mode aggressively conserves power, and normally involvesshutting off power to all devices except the CPU core and memory, which is keptin a very low power mode. Most laptops can stay suspended, using battery poweralone, for several days. ("Hibernation" is a kind of super-suspend, where allthat state is written to disk and the machine uses even less power bcause itcan turn off that CPU core, using no battery power at all. At this writing,Linux does not support hibernation.)PCMCIA devices should be manually suspended usingcardctl(8),and some modular drivers may need to be unloaded.

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 (such asinvokingapm -s)caused this.

The BIOS "standby" mode slightly conserves power, and leaves themachine able to respond almost immediately to user activity.Most laptops can't stay in standby mode for even a day, if they mustrely on battery power. Normally, nothing needs to be done beyondwhat the BIOS itself will do.

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, eitherthe "suspend" mode (possibly a "critical" suspend) or else "standby" mode.

The system clock must be updated to match the hardware clock; this willnormally have been handled by the kernel's APM driver.PCMCIA devices may need to be manually resumed from standby usingcardctl(8),and some modular drivers may need to be reloaded or otherwise reinitialized.In the case of a critical suspend, system state may not have been completelysaved due to an emergency shutdown; applications and drivers may be ina confused state.

change power
This presents a subset of the APM driver "power change" events, specificallythose where AC power was added or removed.This will often modify the system wide power policy; for example, so that IDEhard drives aggressively enter standby mode when only battery power is available.
change battery
The APM driver has reported that the BIOS thinks the strength of one (or more)batteries is "low"; at least ten minutes of power should remain.
change capability
Some change in the power management capabilities of the system was reported.It may have been caused by operation of some setup utility, or by the arrivalor removal of some devices.

This daemon issues a number of different log messages, most of which shouldbe self explanatory. The messages emitted for battery status need someexplanation, however. The information logged contains 4 fields after a "Battery" or "Charge" label:

1) Rate of discharge (percent/minute). Negative rates indicate charging.
2) Time since total charge or total discharge (hh:mm:ss). This value isonly useful if it reflects the time since a 100% or 0% state has beenreached. Otherwise, this time is in parentheses, and reflects the timesince the last "important"apmdstatus change such as starting the daemon, changing from AC power to batterypower, and so on.
3) Estimate of time left until total discharge (or total charge), assuminguse similar to that since the last resume ( or since AC was connected).This time is calculated byapmditself.
4) Parenthetically, the percent and length of remaining battery life, asestimated by the APM BIOS (which is often a conservative estimate from anintelligent battery itself). This particular information is provided withmost messages from this daemon.

This daemon supports APM BIOS 1.2 events, though it does not support someof the advanced features such as multiple batteries. Also,there is no interaction yet with ACPI support as found in newer PC hardware. 

OPTIONS

-c seconds, --check seconds
Controls how many seconds to block on the /dev/apm_bios device. Normallythe daemon blocks until the APM driver reports an event; this number may bechanged to cause battery charge or discharge rates to be checked more often.
-P proxy_cmd, --apmd_proxy proxy_cmd
Identifies the command to invoke when certain APM driver events are reported.See above for information about the arguments to this script.
-p percent_change, --percentage percent_change
Every time the percentage of available power changes (discharge or recharge) bypercent_change,log information. The default is 5. Use values greater than 100 to disablethis feature.
-V, --version
Print the daemon's version and exit.
-v, --verbose
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 bythe -w level or by the APM BIOS) usingsyslog(2),also usewall(1)to alert all users. This is most useful ifsyslogd(8)is not set up to write ALERT messages to all users. If both methods areused, more warnings will be made during the critical time period.
-w warn_percent, --warn warn_percent
When the battery is not being charged and the percentage of available powerdrops belowwarn_percent,log a warning at ALERT level tosyslog(2).If the-Wor--wallflag was given, the daemon will also usewall(1)to alert all users of impending doom. Give the warning each time thepercentage changes. The default is 10. Use negative values to disablethis feature.
-q, --quiet
Disables the warnings identified by the -Wand-woptions. (The APM BIOS on many machines will provide an audible warningwhen power is about to be used up, so those extra warnings may not be needed.)
-?, --help
Prints a usage message and exits.

New software should only use theproxyscript, rather than the following now-deprecated options (most of whichhave never appeared in a production release).If they are provided, they take precedence over any proxy commandinvocation for each event.

-a ac_online_cmd, --ac_online ac_online_cmd
Provides a command to be run when AC power becomes available, though notwhen the daemon first starts.
-b ac_offline_cmd, --ac_offline ac_offline_cmd
Provides a command to be run when the machine is operating onbattery power, though not when the daemon first starts.
-l low_battery_cmd, --low_battery low_battery_cmd
Provides a command to be run when the APM BIOS judges thatbattery power is "low".
-s pre_suspend_cmd, --pre_suspend pre_suspend_cmd
Provides a command to be run before suspending through the driver.
-r post_resume_cmd, --post_resume post_resume_cmd
Provides a command to be run after resuming through the driver.
-u, --utc
(This option is now completely ignored. Edit apmd_proxy instead.)This means the BIOS clock is set to UTC (GMT), so the daemon should pass the-u option to theclockorhwclockprogram when coming out of suspend or resume mode, or when respondingto the BIOS update time event.

 

BUGS

The first status report printed after a power change may beinaccurate because the power change occured at a fractional percentage thatwas rounded to a full percentage. For example, say you are discharging themachine and have 50.9% power, which is reported as 50%. When you start tocharge the machine, it will only have 0.1% left before the percentage flipsto 51%, and the charge rate will be dramatically over-estimated.

There needs to be a more general hook to let other applications participatein system power management decisions and policies.

Multiple batteries are currently treated as if they were just one large one. 

FILES

/dev/apm_bios
/proc/apm
/etc/apmd/apmd_proxy 

AUTHOR

This program was written by Rik Faith (faithAATTcs.unc.edu) and may be freelydistributed under the terms of the GNU General Public License. There isABSOLUTELY NO WARRANTY for this program. The current maintainer is AveryPennarun (apenwarrAATTworldvisions.ca). 

SEE ALSO

apm(1), xapm(1), cardctl(8), hdparm(8), syslogd(8)


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
BUGS
FILES
AUTHOR
SEE ALSO

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector