summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/apmd/apmd.823
-rw-r--r--usr.sbin/apmd/apmd.c38
-rw-r--r--usr.sbin/apmd/pathnames.h2
3 files changed, 9 insertions, 54 deletions
diff --git a/usr.sbin/apmd/apmd.8 b/usr.sbin/apmd/apmd.8
index b073f2a5605..464b1d4d4de 100644
--- a/usr.sbin/apmd/apmd.8
+++ b/usr.sbin/apmd/apmd.8
@@ -24,7 +24,7 @@
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: apmd.8,v 1.14 2001/03/22 05:24:03 angelos Exp $
+.\" $Id: apmd.8,v 1.15 2001/03/22 06:06:27 deraadt Exp $
.\"
.Dd March 24, 1996
.Dt APMD 8
@@ -154,27 +154,20 @@ flushing the buffer cache.
.Pp
Actions can be configured for the three transitions:
.Cm suspend ,
-.Cm standby ,
-.Cm resume ,
-.Cm powerup
+.Cm standby
and
-.Cm powerdown .
+.Cm resume .
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.
-The powerup and powerdown programs are run after the power status (AC
-connected or not) changes, as well as after a resume (if the power
-status changed in the mean time).
.Sh FILES
.Pa /etc/apm/suspend ,
-.Pa /etc/apm/standby ,
-.Pa /etc/apm/resume ,
-.Pa /etc/apm/powerup
+.Pa /etc/apm/standby
and
-.Pa /etc/apm/powerdown
+.Pa /etc/apm/resume
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
@@ -186,10 +179,8 @@ may determine which transition is in progress by examining its
which is set to one of
.Ar suspend ,
.Ar standby ,
-.Ar resume ,
-.Ar powerup
-and
-.Ar powerdown .
+or
+.Ar resume .
.Pp
.Pa /var/run/apmdev
is the default UNIX-domain socket used for communication with
diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c
index ab38ebe7e62..55aa461ba02 100644
--- a/usr.sbin/apmd/apmd.c
+++ b/usr.sbin/apmd/apmd.c
@@ -70,8 +70,6 @@ enum apm_state handle_client(int sock_fd, int ctl_fd);
void suspend(int ctl_fd);
void stand_by(int ctl_fd);
void resume(int ctl_fd);
-void powerup(int ctl_fd);
-void powerdown(int ctl_fd);
void sigexit(int signo);
void make_noise(int howmany);
void do_etc_file(const char *file);
@@ -266,17 +264,6 @@ int howmany;
return;
}
-void
-powerup(int ctl_fd)
-{
- do_etc_file(_PATH_APM_ETC_POWERUP);
-}
-
-void
-powerdown(int ctl_fd)
-{
- do_etc_file(_PATH_APM_ETC_POWERDOWN);
-}
void
suspend(int ctl_fd)
@@ -318,7 +305,6 @@ main(int argc, char *argv[])
int statonly = 0;
int enableonly = 0;
int pctonly = 0;
- int powerstatus = 0, powerbak = 0, powerchange = 0;
int messages = 0;
fd_set *devfdsp, *selfdsp;
struct apm_event_info apmevent;
@@ -418,11 +404,7 @@ main(int argc, char *argv[])
if (ready == 0) {
/* wakeup for timeout: take status */
- powerbak = power_status(ctl_fd, 0, 0);
- if (powerstatus != powerbak) {
- powerstatus = powerbak;
- powerchange = 1;
- }
+ power_status(ctl_fd, 0, 0);
}
if (FD_ISSET(ctl_fd, selfdsp)) {
suspends = standbys = resumes = 0;
@@ -448,19 +430,10 @@ main(int argc, char *argv[])
case APM_NORMAL_RESUME:
case APM_CRIT_RESUME:
case APM_SYS_STANDBY_RESUME:
- powerbak = power_status(ctl_fd, 0, 0);
- if (powerstatus != powerbak) {
- powerstatus = powerbak;
- powerchange = 1;
- }
resumes++;
break;
case APM_POWER_CHANGE:
- powerbak = power_status(ctl_fd, 0, 0);
- if (powerstatus != powerbak) {
- powerstatus = powerbak;
- powerchange = 1;
- }
+ power_status(ctl_fd, 0, 0);
break;
default:
break;
@@ -477,13 +450,6 @@ main(int argc, char *argv[])
resume(ctl_fd);
syslog(LOG_NOTICE, "system resumed from APM sleep");
}
- if (powerchange) {
- if (powerstatus)
- powerup(ctl_fd);
- else
- powerdown(ctl_fd);
- powerchange = 0;
- }
ready--;
}
if (ready == 0)
diff --git a/usr.sbin/apmd/pathnames.h b/usr.sbin/apmd/pathnames.h
index d0961aeeee0..393f19f9151 100644
--- a/usr.sbin/apmd/pathnames.h
+++ b/usr.sbin/apmd/pathnames.h
@@ -33,7 +33,5 @@
#define _PATH_APM_ETC_SUSPEND _PATH_APM_ETC_DIR"/suspend"
#define _PATH_APM_ETC_STANDBY _PATH_APM_ETC_DIR"/standby"
#define _PATH_APM_ETC_RESUME _PATH_APM_ETC_DIR"/resume"
-#define _PATH_APM_ETC_POWERUP _PATH_APM_ETC_DIR"/powerup"
-#define _PATH_APM_ETC_POWERDOWN _PATH_APM_ETC_DIR"/powerdown"
#define _PATH_APM_NORMAL "/dev/apm"
#define _PATH_DEV_SPEAKER "/dev/speaker"