[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: standby when using remote



Hi Gee

On Thu, Nov 22, 2001 at 09:58:51PM +0100, Nagy Gabor wrote:
> But what if I just left my machine alone, when it is busy doing
> something local. Say no IRQs. No hd, no net, just doing sg. Like
> counting. I would like it to be running when it's busy, but then after
> finished, go to sleep.
> 
> Can I do that? Is there another daemon for something like this?
Here's a quick hack I did for when I'm compiling a kernel.  It looks at the
load average every 10 seconds and initiates a suspend if it drops below
zero.  You could do the same sort of thing with apm-sleep using sleepctl
maybe.

It's not really an exact solution for your problem, but it should give you
an idea about how to start.

I think the ideal solution is to have an extra option in apm-sleep.  How
about filing a wishlist bug?

Chris

-- 
Chris Halls | Frankfurt, Germany
#!/bin/sh
#
# Suspend the machine if load average drops below 1
while true ; do 
  if [ `cat /proc/loadavg | cut -f1 -d.` -lt 1 ] ; then
    apm --suspend 
  else uptime
  fi 
  sleep 10
done

Reply to: