OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / apmd / original / man8 / apmd.8
1 .\" apmd.8 -- 
2 .\" Created: Wed Jan 10 15:07:25 1996 by faith@acm.org
3 .\" Revised: Fri Dec 26 20:34:52 1997 by faith@acm.org
4 .\" Revised: Wed Jun  2 18:47:02 1999 by db@post.harvard.edu
5 .\" Copyright 1996, 1997 Rickard E. Faith (faith@acm.org)
6 .\" Copyright 1999 David Brownell (db@post.harvard.edu)
7 .\" 
8 .\" Permission is granted to make and distribute verbatim copies of this
9 .\" manual provided the copyright notice and this permission notice are
10 .\" preserved on all copies.
11 .\" 
12 .\" Permission is granted to copy and distribute modified versions of this
13 .\" manual under the conditions for verbatim copying, provided that the
14 .\" entire resulting derived work is distributed under the terms of a
15 .\" permission notice identical to this one
16 .\" 
17 .\" Since the Linux kernel and libraries are constantly changing, this
18 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
19 .\" responsibility for errors or omissions, or for damages resulting from
20 .\" the use of the information contained herein.  The author(s) may not
21 .\" have taken the same level of care in the production of this manual,
22 .\" which is licensed free of charge, as they might when working
23 .\" professionally.
24 .\" 
25 .\" Formatted or processed versions of this manual, if unaccompanied by
26 .\" the source, must acknowledge the copyright and authors of this work.
27 .\" 
28 .TH APMD 8 "10 Jun 1999" "" "Linux Programmer's Manual"
29 .SH NAME
30 apmd \- Advanced Power Management (APM) daemon
31 .SH SYNOPSIS
32 .BI "apmd"
33 .BI "[ \-c " check_seconds " ]
34 .BI "[ \-P " proxy_cmd " ]"
35 .BI "[ \-p " percent_to_log " ]"
36 .BI "[ \-qVvW ]"
37 .BI "[ \-w " warn_percent " ]
38 .BI "[ \-? ]"
39 .I "[deprecated options]"
40 .SH DESCRIPTION
41 .B apmd
42 is an APM monitoring daemon, and works in conjunction with the
43 APM BIOS driver in the OS kernel.  It can execute a command (normally a shell
44 script) when certain events are reported by the driver, and will log, via
45 .BR syslogd (8),
46 certain changes in system power status.  When the available battery power becomes
47 very low, it can alert all users on the system using several methods.
48 .PP
49 When the kernel APM driver notifies the daemon of
50 a pending suspend or standby request,
51 .B apmd
52 will invoke the approprate command,
53 log the event, 
54 .BR sync (2)
55 data to the disk,
56 sleep briefly to help ensure all the data actually gets to the disk,
57 and then tell the APM driver to continue its operation.
58 However, for "critical" suspends (indicating an emergency shutdown)
59 only the last step (telling the driver to continue) is performed.
60 .PP
61 Most uses of this daemon will use the
62 .I proxy
63 command to support power conservation activities.  This command is
64 searched for by default in
65 .I /etc/apmd_proxy
66 and is invoked with one or two arguments:
67 .TP
68 .B start
69 Invoked when the daemon starts.  Normally sets system-wide power policy, such as
70 IDE hard drive standby times, to account for whether battery power is in use.
71 .TP
72 .B stop
73 Invoked when the daemon stops.  Normally undoes any policy settings done when the
74 daemon started.
75 .TP
76 .B suspend "[ system | user ]"
77 .\".B suspend "[ system | user | critical ]"
78 Invoked when the APM driver reports that system suspension has been initiated.
79 The second parameter indicates whether the BIOS or a user action (such as closing
80 a laptop) initiated suspension.
81 .ig
82 A "critical" suspend is initiated by the BIOS when an emergency shutdown needs
83 to happen.  Applications and device drivers are not be notified since there
84 isn't enough time to safely do anything about the shutdown.
85 ..
86 .sp
87 The BIOS "suspend" mode aggressively conserves power, and normally involves
88 shutting off power to all devices except the CPU core and memory, which is kept
89 in a very low power mode.  Most laptops can stay suspended, using battery power
90 alone, for several days.  ("Hibernation" is a kind of super-suspend, where all
91 that state is written to disk and the machine uses even less power bcause it
92 can turn off that CPU core, using no battery power at all.  At this writing,
93 Linux does not support hibernation.)
94 PCMCIA devices should be manually suspended using
95 .BR cardctl (8),
96 and some modular drivers may need to be unloaded.
97 .TP
98 .B standby "[ system | user ]"
99 Invoked when the APM driver reports that system standby has been initiated.
100 The second parameter indicates whether the BIOS or a user action (such as
101 invoking
102 .IR "apm -s" )
103 caused this.
104 .sp
105 The BIOS "standby" mode slightly conserves power, and leaves the
106 machine able to respond almost immediately to user activity.
107 Most laptops can't stay in standby mode for even a day, if they must
108 rely on battery power.  Normally, nothing needs to be done beyond
109 what the BIOS itself will do.
110 .TP
111 .B resume "[ suspend | standby | critical ]"
112 Invoked when the APM driver reports that system has resumed normal operation.
113 The second parameter indicates what sort of mode it was in before, either
114 the "suspend" mode (possibly a "critical" suspend) or else "standby" mode.
115 .sp
116 The system clock must be updated to match the hardware clock; this will
117 normally have been handled by the kernel's APM driver.
118 PCMCIA devices may need to be manually resumed from standby using
119 .BR cardctl (8),
120 and some modular drivers may need to be reloaded or otherwise reinitialized.
121 In the case of a critical suspend, system state may not have been completely
122 saved due to an emergency shutdown; applications and and drivers may be in
123 a confused state.
124 .TP
125 .B change power
126 This presents a subset of the APM driver "power change" events, specifically
127 those where AC power was added or removed.
128 This will often modify the system wide power policy; for example, so that IDE
129 hard drives aggressively enter standby mode when only battery power is available.
130 .ig
131 .TP
132 .B change time
133 The system clock must be updated to match the hardware clock; this will
134 normally have been handled by the kernel's APM driver.
135 ..
136 .TP
137 .B change battery
138 The APM driver has reported that the BIOS thinks the strength of one (or more)
139 batteries is "low"; at least ten minutes of should power remain.
140 .TP
141 .B change capability
142 Some change in the power management capabilities of the system was reported.
143 It may have been caused by operation of some setup utility, or by the arrival
144 or removal of some devices.
145 .PP
146 This daemon issues a number of different log messages, most of which should
147 be self explanatory.  The messages emitted for battery status need some
148 explanation, however. 
149 The information logged contains 4 fields after a "Battery" or "Charge" label:
150 .HP
151 1) Rate of discharge (percent/minute).  Negative rates indicate charging.
152 .HP
153 2) Time since total charge or total discharge (hh:mm:ss).  This value is
154 only useful if it reflects the time since a 100% or 0% state has been
155 reached.  Otherwise, this time is in parentheses, and reflects the time
156 since the last "important"
157 .B apmd
158 status change such as starting the daemon, changing from AC power to battery
159 power, and so on.
160 .HP
161 3) Estimate of time left until total discharge (or total charge), assuming
162 use similar to that since the last resume ( or since AC was connected).
163 This time is calculated by
164 .B apmd
165 itself.
166 .HP
167 4) Parenthetically, the percent and length of remaining battery life, as
168 estimated by the APM BIOS (which is often a conservative estimate from an
169 intelligent battery itself).  This particular information is provided with
170 most messages from this daemon.
171 .PP
172 This daemon supports APM BIOS 1.2 events, though it does not support some
173 of the advanced features such as multiple batteries.  Also,
174 there is no interaction yet with ACPI support as found in newer PC hardware.
175 .SH OPTIONS
176 .TP
177 .BR "\-c " seconds, " \--check " seconds
178 Controls how many seconds to block on the \fI/dev/apm_bios\fR device.  Normally
179 the daemon blocks until the APM driver reports an event; this number may be
180 changed to cause battery charge or discharge rates to be checked more often.
181 .TP
182 .BR "\-P " proxy_cmd, " \-\-apmd_proxy " proxy_cmd
183 Identifies the command to invoke when certain APM driver events are reported.
184 See above for information about the arguments to this script.
185 .TP
186 .BR "\-p " percent_change, " \--percentage " percent_change
187 Every time the percentage of available power changes (discharge or recharge) by
188 .IR percent_change ,
189 log information.  The default is 5.  Use values greater than 100 to disable
190 this feature.
191 .TP
192 .B \-V, \-\-version
193 Print the daemon's version and exit.
194 .TP
195 .B \-v, \-\-verbose
196 Enables verbose mode, where each event reported by the APM driver is logged.
197 .TP
198 .B \-W, \-\-wall
199 In addition to logging low battery status (as determined either by
200 the \fB-w\fR level or by the APM BIOS) using
201 .BR syslog (2),
202 also use
203 .BR wall (1)
204 to alert all users.  This is most useful if
205 .BR syslogd (8)
206 is not set up to write ALERT messages to all users.  If both methods are
207 used, more warnings will be made during the critical time period.
208 .TP
209 .BR "\-w " warn_percent, " \--warn " warn_percent
210 When the battery is not being charged and the percentage of available power
211 drops below
212 .IR warn_percent ,
213 log a warning at ALERT level to
214 .BR syslog (2).
215 If the
216 .B \-W
217 or
218 .B \-\-wall
219 flag was given, the daemon will also use
220 .BR wall (1)
221 to alert all users of impending doom.  Give the warning each time the
222 percentage changes.  The default is 10.  Use negative values to disable
223 this feature.
224 .TP
225 .B \-q, \-\-quiet
226 Disables the warnings identified by the 
227 .B -W
228 and
229 .B -w
230 options.  (The APM BIOS on many machines will provide an audible warning
231 when power is about to be used up, so those extra warnings may not be needed.)
232 .TP
233 .B \-?, \-\-help
234 Prints a usage message and exits.
235 .PP
236 New software should only use the
237 .I proxy
238 script, rather than the following now-deprecated options (most of which
239 have never appeared in a production release).
240 If they are provided, they take precedence over any proxy command
241 invocation for each event.
242 .TP
243 .BR "\-a " ac_online_cmd, " \-\-ac_online " ac_online_cmd
244 Provides a command to be run when AC power becomes available, though not
245 when the daemon first starts.
246 .TP
247 .BR "\-b " ac_offline_cmd, " \-\-ac_offline " ac_offline_cmd
248 Provides a command to be run when the machine is operating on
249 battery power, though not when the daemon first starts.
250 .TP
251 .BR "\-l " low_battery_cmd, " \-\-low_battery " low_battery_cmd
252 Provides a command to be run when the APM BIOS judges that
253 battery power is "low".
254 .TP
255 .BR "\-s " pre_suspend_cmd, " \-\-pre_suspend " pre_suspend_cmd
256 Provides a command to be run before suspending through the driver. 
257 .TP
258 .BR "\-r " post_resume_cmd, " \-\-post_resume " post_resume_cmd
259 Provides a command to be run after resuming through the driver. 
260 .TP
261 .B \-u, \-\-utc
262 (This option is now completely ignored.)
263 The BIOS clock is set to UTC (GMT), so the daemon should pass the -u option to the
264 .I clock
265 or
266 .I hwclock
267 program when coming out of suspend or resume mode, or when responding
268 to the BIOS update time event.
269 .SH BUGS
270 The first status report printed after a power change may be
271 inaccurate because the power change occured at a fractional percentage that
272 was rounded to a full percentage.  For example, say you are discharging the
273 machine and have 50.9% power, which is reported as 50%.  When you start to
274 charge the machine, it will only have 0.1% left before the percentage flips
275 to 51%, and the charge rate will be dramatically over-estimated.
276 .PP
277 There needs to be a more general hook to let other applications participate
278 in system power management decisions and policies.
279 .PP
280 Multiple batteries are currently treated as if they were just one large one.
281 .SH FILES
282 .I /dev/apm_bios
283 .br
284 .I /proc/apm
285 .br
286 .I /etc/apmd/apmd_proxy
287 .SH AUTHOR
288 This program was written by Rik Faith (faith@cs.unc.edu) and may be freely
289 distributed under the terms of the GNU General Public License.  There is
290 ABSOLUTELY NO WARRANTY for this program.  The current maintainer is Avery
291 Pennarun (apenwarr@worldvisions.ca).
292 .SH "SEE ALSO"
293 .BR apm "(1), " xapm "(1), " cardctl "(8), " hdparm "(8), " syslogd "(8)"