1998-11-19 22:39:14 +03:00
|
|
|
.\" $NetBSD: apmd.8,v 1.8 1998/11/19 19:39:14 kenh Exp $
|
1996-09-25 04:53:45 +04:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
|
1996-08-26 03:38:57 +04:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
1996-09-25 04:53:45 +04:00
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by John Kohl.
|
|
|
|
.\"
|
1996-08-26 03:38:57 +04:00
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
1996-09-25 04:53:45 +04:00
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the NetBSD
|
|
|
|
.\" Foundation, Inc. and its contributors.
|
|
|
|
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
.\" contributors may be used to endorse or promote products derived
|
|
|
|
.\" from this software without specific prior written permission.
|
1996-08-26 03:38:57 +04:00
|
|
|
.\"
|
1996-09-25 04:53:45 +04:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
1997-07-31 02:53:50 +04:00
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
1996-09-25 04:53:45 +04:00
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
1996-08-26 03:38:57 +04:00
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
1996-09-13 05:10:14 +04:00
|
|
|
.Dd September 12, 1996
|
1996-08-26 03:38:57 +04:00
|
|
|
.Dt APMD 8
|
|
|
|
.Os NetBSD
|
|
|
|
.Sh NAME
|
|
|
|
.Nm apmd
|
|
|
|
.Nd Advanced Power Management monitor daemon
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Fl d
|
|
|
|
.Op Fl s
|
|
|
|
.Op Fl a
|
|
|
|
.Op Fl q
|
|
|
|
.Op Fl t Ar seconds
|
|
|
|
.Op Fl S Ar sockname
|
1996-09-13 05:10:14 +04:00
|
|
|
.Op Fl m Ar sockmode
|
|
|
|
.Op Fl o Ar sockowner:sockgroup
|
1996-08-26 03:38:57 +04:00
|
|
|
.Op Fl f Ar devname
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
monitors the advanced power management (APM) pseudo-device, acting on
|
|
|
|
signaled events and upon user requests as sent by the
|
|
|
|
.Xr apm 8
|
1997-10-03 09:37:05 +04:00
|
|
|
utility.
|
1996-08-26 03:38:57 +04:00
|
|
|
For suspend and standby request events delivered by the BIOS, or via
|
|
|
|
.Xr apm 8 ,
|
|
|
|
.Nm
|
|
|
|
runs the appropriate configuration program (if one exists),
|
|
|
|
syncs the buffer cache to disk and initiates the requested mode.
|
|
|
|
When resuming after suspend or standby,
|
|
|
|
.Nm
|
1997-10-03 09:37:05 +04:00
|
|
|
runs the appropriate configuration utility (if one exists).
|
1996-08-26 03:38:57 +04:00
|
|
|
For power status change events,
|
|
|
|
.Nm
|
|
|
|
fetches the current status and reports it via
|
|
|
|
.Xr syslog 3
|
|
|
|
with logging facility
|
|
|
|
.Dv LOG_DAEMON .
|
|
|
|
.Pp
|
|
|
|
.Nm
|
|
|
|
announces the transition to standby mode with a single high tone on the
|
|
|
|
speaker (using the
|
|
|
|
.Pa /dev/speaker
|
|
|
|
device).
|
|
|
|
Suspends are announced with two high tones.
|
|
|
|
.Pp
|
|
|
|
.Nm
|
|
|
|
periodically polls the APM driver for the current power state.
|
|
|
|
If the battery charge level changes substantially or the external power
|
|
|
|
status changes, the new status is logged. The polling rate defaults to
|
|
|
|
once per 10 minutes, but may be specified using the
|
|
|
|
.Fl t
|
|
|
|
command-line flag.
|
|
|
|
.Pp
|
|
|
|
If the
|
|
|
|
.Fl s
|
|
|
|
flag is specified, the current battery statistics are reported via
|
|
|
|
.Xr syslog 3
|
|
|
|
and
|
|
|
|
.Nm
|
|
|
|
exits without monitoring the APM status.
|
|
|
|
.Pp
|
|
|
|
If the
|
|
|
|
.Fl a
|
|
|
|
flag is specified, any BIOS-initiated suspend or standby requests are
|
|
|
|
ignored if the system is connected to line current and not running from
|
|
|
|
batteries (user requests are still honored).
|
|
|
|
.Pp
|
|
|
|
If the
|
|
|
|
.Fl d
|
|
|
|
flag is specified,
|
|
|
|
.Nm
|
|
|
|
enters debug mode, logging to facility
|
|
|
|
.Dv LOG_LOCAL1
|
|
|
|
and staying in the foreground on the controlling terminal.
|
|
|
|
.Pp
|
|
|
|
If the
|
|
|
|
.Fl q
|
|
|
|
flag is specified,
|
|
|
|
.Nm
|
|
|
|
does not announce suspend and standby requests on the speaker.
|
|
|
|
.Pp
|
|
|
|
When a client requests a suspend or stand-by mode,
|
|
|
|
.Nm
|
|
|
|
does not wait for positive confirmation that the requested
|
|
|
|
mode has been entered before replying to the client; to do so would mean
|
|
|
|
the client does not get a reply until the system resumes from its sleep state.
|
|
|
|
Rather,
|
|
|
|
.Nm
|
|
|
|
replies with the intended state to the client and then places the system
|
|
|
|
in the requested mode after running the configuration script and
|
|
|
|
flushing the buffer cache.
|
|
|
|
.Pp
|
1998-11-19 22:39:14 +03:00
|
|
|
Actions can be configured for the five transitions:
|
1996-08-26 03:38:57 +04:00
|
|
|
.Cm suspend ,
|
1998-11-19 22:39:14 +03:00
|
|
|
.Cm standby ,
|
|
|
|
.Cm resume ,
|
|
|
|
.Cm line
|
|
|
|
or
|
|
|
|
.Cm battery .
|
1996-08-26 03:38:57 +04:00
|
|
|
The suspend and standby actions are run prior to
|
|
|
|
.Nm
|
|
|
|
performing any other actions (such as disk syncs) and entering the new
|
|
|
|
mode. The resume program is run after resuming from a stand-by or
|
|
|
|
suspended state.
|
1998-11-19 22:39:14 +03:00
|
|
|
.Pp
|
|
|
|
The line and battery actions are run after switching power sources to
|
|
|
|
AC (line) or battery, respectively. The appropriate line or battery action
|
|
|
|
is also run upon the startup of apmd based on the current power source.
|
1996-08-26 03:38:57 +04:00
|
|
|
.Sh FILES
|
|
|
|
.Pa /etc/apm/suspend ,
|
1998-11-19 22:39:14 +03:00
|
|
|
.Pa /etc/apm/standby ,
|
|
|
|
.Pa /etc/apm/resume ,
|
|
|
|
.Pa /etc/apm/line
|
1996-08-26 03:38:57 +04:00
|
|
|
and
|
1998-11-19 22:39:14 +03:00
|
|
|
.Pa /etc/apm/battery
|
1996-08-26 03:38:57 +04:00
|
|
|
are the files that contain the host's customized actions.
|
|
|
|
Each file must be an executable binary or shell script suitable
|
|
|
|
for execution by the
|
|
|
|
.Xr execve 2
|
|
|
|
function.
|
|
|
|
If you wish to have the same program or script control all transitions, it
|
|
|
|
may determine which transition is in progress by examining its
|
|
|
|
.Va argv[0]
|
|
|
|
which is set to one of
|
|
|
|
.Ar suspend ,
|
|
|
|
.Ar standby ,
|
1998-11-19 22:39:14 +03:00
|
|
|
.Ar resume ,
|
|
|
|
.Ar line
|
1996-08-26 03:38:57 +04:00
|
|
|
or
|
1998-11-19 22:39:14 +03:00
|
|
|
.Ar battery .
|
1996-08-26 03:38:57 +04:00
|
|
|
.Pp
|
|
|
|
.Pa /var/run/apmdev
|
|
|
|
is the default UNIX-domain socket used for communication with
|
|
|
|
.Xr apm 8 .
|
|
|
|
The
|
|
|
|
.Fl S
|
|
|
|
flag may be used to specify an alternate socket name.
|
1996-09-13 05:10:14 +04:00
|
|
|
The socket is protected by default to mode 0660, UID 0, GID 0;
|
|
|
|
the
|
|
|
|
.Fl m
|
|
|
|
and
|
|
|
|
.Fl o
|
|
|
|
flags may be used to specify different modes or owners/groups, respectively.
|
1996-08-26 03:38:57 +04:00
|
|
|
.Pp
|
|
|
|
.Pa /dev/apmctl
|
|
|
|
is the default device used to control the APM kernel driver.
|
|
|
|
The
|
|
|
|
.Fl f
|
|
|
|
flag may be used to specify an alternate device file name.
|
|
|
|
.Sh SEE ALSO
|
1997-07-11 08:36:16 +04:00
|
|
|
.Xr execve 2 ,
|
|
|
|
.Xr syslog 3 ,
|
1996-08-26 03:38:57 +04:00
|
|
|
.Xr apm 4 ,
|
|
|
|
.Xr speaker 4 ,
|
1997-07-11 08:36:16 +04:00
|
|
|
.Xr apm 8 ,
|
1996-08-26 03:38:57 +04:00
|
|
|
.Xr syslogd 8 .
|
|
|
|
.Sh REFERENCES
|
|
|
|
Advanced Power Management (APM) BIOS Interface Specification (revision
|
|
|
|
1.1), Intel Corporation and Microsoft Corporation.
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
1997-10-17 08:57:31 +04:00
|
|
|
.Nm
|
1997-10-03 09:37:05 +04:00
|
|
|
command appeared in
|
|
|
|
.Nx 1.3 .
|