2012-04-09 02:00:37 +04:00
|
|
|
.\" $NetBSD: apmd.8,v 1.22 2012/04/08 22:00:40 wiz Exp $
|
1996-09-25 04:53:45 +04:00
|
|
|
.\"
|
2010-03-20 12:22:37 +03:00
|
|
|
.\" Copyright (c) 1996, 2010 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
|
|
|
.\" 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
|
2001-04-03 15:24:20 +04:00
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
1997-07-31 02:53:50 +04:00
|
|
|
.\" 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.
|
|
|
|
.\"
|
2010-03-20 12:22:37 +03:00
|
|
|
.Dd March 20, 2010
|
1996-08-26 03:38:57 +04:00
|
|
|
.Dt APMD 8
|
1999-03-22 21:43:46 +03:00
|
|
|
.Os
|
1996-08-26 03:38:57 +04:00
|
|
|
.Sh NAME
|
|
|
|
.Nm apmd
|
|
|
|
.Nd Advanced Power Management monitor daemon
|
|
|
|
.Sh SYNOPSIS
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2000-03-05 00:27:17 +03:00
|
|
|
.Op Fl adlqsv
|
2012-04-09 02:00:37 +04:00
|
|
|
.Op Fl f Ar devname
|
1996-09-13 05:10:14 +04:00
|
|
|
.Op Fl m Ar sockmode
|
|
|
|
.Op Fl o Ar sockowner:sockgroup
|
2012-04-09 02:00:37 +04:00
|
|
|
.Op Fl S Ar sockname
|
|
|
|
.Op Fl t Ar rate
|
1996-08-26 03:38:57 +04:00
|
|
|
.Sh DESCRIPTION
|
2010-03-20 12:22:37 +03:00
|
|
|
The
|
1996-08-26 03:38:57 +04:00
|
|
|
.Nm
|
2010-03-20 12:22:37 +03:00
|
|
|
daemon monitors the Advanced Power Management
|
|
|
|
.Pq Tn APM
|
|
|
|
pseudo-device, acting on
|
1996-08-26 03:38:57 +04:00
|
|
|
signaled events and upon user requests as sent by the
|
2001-04-03 15:24:20 +04:00
|
|
|
.Xr apm 8
|
1997-10-03 09:37:05 +04:00
|
|
|
utility.
|
2008-09-26 02:44:51 +04:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
daemon is only installed on supported platforms.
|
|
|
|
.Pp
|
2010-03-20 12:22:37 +03:00
|
|
|
.Em The
|
|
|
|
.Nm
|
|
|
|
.Em is largely deprecated.
|
|
|
|
Modern systems supporting
|
|
|
|
.Tn ACPI
|
|
|
|
should rely on
|
|
|
|
.Xr acpi 4 ,
|
|
|
|
.Xr powerd 8 ,
|
|
|
|
and the
|
|
|
|
.Xr envsys 4
|
|
|
|
framework instead.
|
|
|
|
.Pp
|
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
|
2001-04-03 15:24:20 +04:00
|
|
|
.Xr syslog 3
|
1996-08-26 03:38:57 +04:00
|
|
|
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
|
2010-03-20 12:22:37 +03:00
|
|
|
periodically polls the
|
|
|
|
.Tn APM
|
|
|
|
driver for the current power state.
|
1996-08-26 03:38:57 +04:00
|
|
|
If the battery charge level changes substantially or the external power
|
2004-05-16 14:54:12 +04:00
|
|
|
status changes, the new status is logged.
|
|
|
|
The polling rate defaults to
|
2010-03-20 12:22:37 +03:00
|
|
|
once per 10 minutes, but this may be altered by using the
|
1996-08-26 03:38:57 +04:00
|
|
|
.Fl t
|
|
|
|
command-line flag.
|
|
|
|
.Pp
|
|
|
|
.Nm
|
2000-11-05 06:05:48 +03:00
|
|
|
supports the following options:
|
|
|
|
.Bl -tag -width Fl
|
|
|
|
.It Fl a
|
|
|
|
Any BIOS-initiated suspend or standby requests are
|
1996-08-26 03:38:57 +04:00
|
|
|
ignored if the system is connected to line current and not running from
|
|
|
|
batteries (user requests are still honored).
|
2000-11-05 06:05:48 +03:00
|
|
|
.It Fl d
|
|
|
|
Enter debug mode, log to facility
|
1996-08-26 03:38:57 +04:00
|
|
|
.Dv LOG_LOCAL1
|
2000-11-05 06:05:48 +03:00
|
|
|
and stay in the foreground on the controlling terminal.
|
|
|
|
.It Fl f Ar devname
|
|
|
|
Specify an alternate device file name.
|
|
|
|
.It Fl l
|
|
|
|
A low-battery event causes a suspend request to occur.
|
|
|
|
.It Fl m Ar sockmode
|
|
|
|
Use
|
|
|
|
.Ar sockmode
|
2001-04-03 15:24:20 +04:00
|
|
|
instead of
|
2000-11-05 06:05:48 +03:00
|
|
|
.Sq 0660
|
|
|
|
for the mode of
|
|
|
|
.Pa /var/run/apmdev .
|
|
|
|
.It Fl o Ar sockowner:sockgroup
|
|
|
|
Use
|
|
|
|
.Ar sockowner:sockgroup
|
|
|
|
instead of
|
|
|
|
.Sq `0:0'
|
|
|
|
for the owner/group of
|
|
|
|
.Pa /var/run/apmdev .
|
|
|
|
.It Fl q
|
|
|
|
Do not announce suspend and standby requests on the speaker.
|
|
|
|
.It Fl S Ar sockname
|
|
|
|
Specify an alternate socket name (used by
|
2001-04-03 15:24:20 +04:00
|
|
|
.Xr apm 8
|
2000-11-05 06:05:48 +03:00
|
|
|
to communicate with
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm ) .
|
2012-04-09 02:00:37 +04:00
|
|
|
.It Fl s
|
|
|
|
The current battery statistics are reported via
|
|
|
|
.Xr syslog 3
|
|
|
|
and exit without monitoring the APM status.
|
2000-11-05 06:05:48 +03:00
|
|
|
.It Fl t Ar rate
|
2004-05-16 14:54:12 +04:00
|
|
|
Change the polling rate from 600 seconds to
|
2000-11-05 06:05:48 +03:00
|
|
|
.Ar rate
|
|
|
|
seconds.
|
|
|
|
.It Fl v
|
|
|
|
Periodically log the power status via
|
|
|
|
.Xr syslog 3 .
|
|
|
|
.El
|
2000-03-05 00:27:17 +03:00
|
|
|
.Pp
|
1996-08-26 03:38:57 +04:00
|
|
|
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
|
2004-05-16 14:54:12 +04:00
|
|
|
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
|
2004-05-16 14:54:12 +04:00
|
|
|
AC (line) or battery, respectively.
|
|
|
|
The appropriate line or battery action
|
1998-11-19 22:39:14 +03:00
|
|
|
is also run upon the startup of apmd based on the current power source.
|
1996-08-26 03:38:57 +04:00
|
|
|
.Sh FILES
|
2000-11-05 06:05:48 +03:00
|
|
|
.Bl -tag -width /etc/apm/suspend -compact
|
|
|
|
.It Pa /etc/apm/suspend
|
|
|
|
.It Pa /etc/apm/standby
|
|
|
|
.It Pa /etc/apm/resume
|
|
|
|
.It Pa /etc/apm/line
|
|
|
|
.It Pa /etc/apm/battery
|
|
|
|
Contain the host's customized actions.
|
1996-08-26 03:38:57 +04:00
|
|
|
Each file must be an executable binary or shell script suitable
|
|
|
|
for execution by the
|
2001-04-03 15:24:20 +04:00
|
|
|
.Xr execve 2
|
1996-08-26 03:38:57 +04:00
|
|
|
function.
|
|
|
|
If you wish to have the same program or script control all transitions, it
|
2001-04-03 15:24:20 +04:00
|
|
|
may determine which transition is in progress by examining its
|
1996-08-26 03:38:57 +04:00
|
|
|
.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 .
|
2001-04-03 15:24:20 +04:00
|
|
|
See
|
1999-12-29 08:00:43 +03:00
|
|
|
.Pa /usr/share/examples/apm/script
|
|
|
|
for such an example script.
|
1996-08-26 03:38:57 +04:00
|
|
|
.Pp
|
2000-11-05 06:05:48 +03:00
|
|
|
.It Pa /var/run/apmdev
|
|
|
|
The default UNIX-domain socket used for communication with
|
1996-08-26 03:38:57 +04:00
|
|
|
.Xr apm 8 .
|
2000-11-05 06:05:48 +03:00
|
|
|
The socket is protected by default to mode 0660, UID 0, GID 0.
|
1996-08-26 03:38:57 +04:00
|
|
|
.Pp
|
2000-11-05 06:05:48 +03:00
|
|
|
.It Pa /dev/apmctl
|
|
|
|
The default device used to control the APM kernel driver.
|
|
|
|
.El
|
1996-08-26 03:38:57 +04:00
|
|
|
.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 ,
|
2000-02-02 04:55:55 +03:00
|
|
|
.Xr syslogd 8
|
1996-08-26 03:38:57 +04:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
1997-10-17 08:57:31 +04:00
|
|
|
.Nm
|
2010-03-20 12:22:37 +03:00
|
|
|
daemon appeared in
|
1997-10-03 09:37:05 +04:00
|
|
|
.Nx 1.3 .
|