APMD-List:
Archives

  
Back

to

APMD

Home

      Index: [thread] [date] [subject] [author]
  From: Peter Englmaier <ppe@pa.uky.edu>
  To  : apm-list <apmd-list@worldvisions.ca>
  Date: Mon, 2 Aug 1999 14:30:09 -0400 (EDT)

Re: New apmsleep utility

Avery wrote:
> Does anyone besides me think it [apmsleep] would be good to
> integrate such a feature into cron?
I don't like it, because it is against unix rule #1: simplicity. 
It also is not good for rule #2: focus on one thing. Cron would 
never be able to handle all the cases, my apmsched sketch below
could. Also, software 'swiss army knives' are often pain to maintain.
Apmsched would actually be an improved apmd.

However, it would make sense to integrate it into 'apm' 
and in the 'libapm.a'.  

> To do that, we would need to be able to set a "wake up" event without
> actually suspending.  Then if we aren't suspended at the time, do nothing,
> otherwise wake up.  Perhaps this could be an option to the apmsleep command.
You can run apmsleep with the --noapm switch, it will than just set
the alarm and wait for the time-leap. Than later do 'apm -s', and
hope.  The problem I see with this is, that other programs may also
reprogram the RTC alarm. Also, the alarm is canceled by the kernel
when apmsleep exists.  Unfortunately, there can be only one user of
the alarm feature.  A better method:
	at midnight <<EOF
	apmsleep 8:00
	EOF

BTW, apmsleep works at least on one more laptop (Dell Inspiron 7000). 
If apmsleep didn't work for you, please try again as root.

Cheers, Peter.

-----8<-------------8<-------------8<-------------8<-------------8<-----

Purpose: control power on/off to save energy

/etc/apmsched.conf:
MODE=standby/suspend
MINOFFTIME=[time in minutes]    # machine is not turned off, for less time
MAXLOAD=[average loadlevel]     # wait with suspend until workload goes down
NOUSER=yes/no			# Go down only if no user is logged in
				# (for the paranoid)
IRQS=[list of irqs]		# watch these irq's for system activity
				# e.g. keyboard & mouse interrupt
IRQTIME=[time in minutes]       # suspend only, if irq's are silent
				# for given time
ONSUSPEND=[bash cmd. list]	# commands to run always before suspend
ONWAKEUP=[bash cmd. list]	# commands to run always after wakeup
XWARN=yes/no			# popup/wall a warning 1 minute before
				# actually suspending (if activity
				# is detected, the popup should disappear)

/etc/apmsched.schedule:
[minute] [hour] [day-of-week] [day-of-month] [off/on] [optional: script]

The optional scripts are executed before switching off, or after wake up.
Script should be run using 'batch' and they should always run at the
given time, even if apmsched didn't take any wakeup/suspend action [maybe
add an optional argument do schedule for more flexibility].
Maybe 'apmsleep' has to be replaced by something which talks to apmsched.

Only one problem, who is going to code it? And does somebody actually
care about such a program?





Index: [thread] [date] [subject] [author]


Write to me! apenwarr@worldvisions.ca