| Main index | Section 8 | 日本語 | Options |
The apmd utility recognizes the following runtime options:
| | |
| Starts in debug mode. This causes apmd to execute in the foreground instead of in daemon mode. | |
| | |
| Specifies a different configuration file file to be used in place of the default /etc/apmd.conf. | |
| | |
| Causes apmd to simulate a POWERSTATECHANGE event when a power state change is detected (AC_POWER_STATE) but the bios of the laptop does not report it. This enables you to do things like dimming the LCD backlight when you unplug the power cord. | |
| | |
| Verbose mode. | |
When apmd starts, it reads the configuration file ( /etc/apmd.conf as default) and notifies the set of events to be monitored to the APM device driver. When it terminates, the APM device driver automatically cancels monitored events.
If the apmd process receives a SIGHUP, it will reread its configuration file and notify the APM device driver of any changes to its configuration.
The apmd utility uses the device /dev/apmctl to issue ioctl(2) requests for monitoring events and for controlling the APM system. This device file is opened exclusively, so only a single apmd process can be running at any time.
When apmd receives an APM event, it forks a child process to execute the commands specified in the configuration file and then continues listening for more events. The child process executes the commands specified, one at a time and in the order that they are listed.
While apmd is processing the command list for SUSPEND/STANDBY requests, the APM kernel device driver issues notifications to APM BIOS once per second so that the BIOS knows that there are still some commands pending, and that it should not complete the request just yet.
The apmd utility creates the file /var/run/apmd.pid, and stores its process id there. This can be used to kill or reconfigure apmd.
apm_event SUSPENDREQ {
exec "sync && sync && sync";
exec "sleep 1";
exec "zzz";
}
will cause apmd to receive the APM event ‘SUSPENDREQ’ (which may be posted by an LCD close), run the ‘sync’ command 3 times and wait for a while, then execute zzz) to put the system in the suspend state.
|
- Events ignored by the kernel if
apmd
is running:
| |
| STANDBYREQ
USERSTANDBYREQ SUSPENDREQ | |
| should include sync in the command list, | |
| USERSUSPENDREQ | |
| should include sync in the command list, | |
| BATTERYLOW | only zzz should be specified in the command list. |
|
- Events passed to
apmd
after kernel handling:
| |
| NORMRESUME
CRITRESUME STANDBYRESUME POWERSTATECHANGE UPDATETIME CAPABILITIESCHANGE | |
Other events will not be sent to apmd.
| - reject | |
| Reject last request posted by APM BIOS. This can be used to reject a SUSPEND request when the LCD is closed and put the system in a STANDBY state instead. | |
| /etc/apmd.conf
/dev/apmctl /var/run/apmd.pid | |
apm_event SUSPENDREQ {
exec "/etc/rc.suspend apm suspend";
}
apm_event USERSUSPENDREQ {
exec "sync && sync && sync";
exec "sleep 1";
exec "apm -z";
}
apm_event NORMRESUME {
exec "/etc/rc.resume apm suspend";
}
apm_event STANDBYRESUME {
exec "/etc/rc.resume apm standby";
}
# resume event configuration for serial mouse users by
# reinitializing a moused(8) connected to a serial port.
#
#apm_event NORMRESUME {
# exec "kill -HUP `cat /var/run/moused.pid`";
#}
#
# suspend request event configuration for ATA HDD users:
# execute standby instead of suspend.
#
#apm_event SUSPENDREQ {
# reject;
# exec "sync && sync && sync";
# exec "sleep 1";
# exec "apm -Z";
#}
Some contributions made by Warner Losh <Mt imp@FreeBSD.org>, Hiroshi Yamashita <Mt bluemoon@msj.biglobe.ne.jp>, Yoshihiko SARUMARU <Mt mistral@imasy.or.jp>, Norihiro Kumagai <Mt kuma@nk.rim.or.jp>, NAKAGAWA Yoshihisa <Mt nakagawa@jp.FreeBSD.org>, and Nick Hilliard <Mt nick@foobar.org>.
| APMD (8) | June 28, 1999 |
| Main index | Section 8 | 日本語 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | How's my programming? Call 1-800-DEV-NULL | ” |