APMD-List:
Archives

  
Back

to

APMD

Home

      Index: [thread] [date] [subject] [author]
  From: Avery Pennarun <apenwarr@worldvisions.ca>
  To  : Peter Englmaier <ppe@pa.uky.edu>
<apmd-list@worldvisions.ca> Date: Mon, 2 Aug 1999 15:51:05 -0400

Re: New apmsleep utility

On Mon, Aug 02, 1999 at 02:30:09PM -0400, Peter Englmaier 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.

I'm not saying to do it in the ugliest possible way :)  The reason I suggest
it is that cron and at are the time-based-event schedulers in Unix; if my
laptop is suspended, my cron jobs won't run when (presumably) I expect them
to.  It would be relatively trivial (famous last words) to have cron run
"apmsleep --noapm" to wake up for its next job, before it next goes to
sleep.

The problem you mention about only allowing for one pending event on the
entire system does make things worse... perhaps the kernel driver needs to
be modified to improve that situation.  It would be nice if the kernel just
scheduled an alarm for the "earliest" requested event, then queued the next
one afterwards.

> 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)

I really would like to transfer control of the APM functions away from the
BIOS and into Linux -- that way, we could dodge bugs caused by "impatient"
bioses (that really, really want to suspend within a second or two after
generating a suspend event).  Plus, we would have an obvious way to control
which devices do/don't affect automatic standby and suspend.  I'm especially
interested in having a way to hold off suspending until the load average
goes down.

However, I think that's something that should be done in the kernel.  Most
of the rest of what apmsched would do is already in apmd.

But as usual, I don't have time to implement this myself.

Have fun,

Avery


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


Write to me! apenwarr@worldvisions.ca