Re: Tweaking cron for use on laptops

1996-12-13 Thread Michael Shields
In article [EMAIL PROTECTED],
Bruce Perens [EMAIL PROTECTED] wrote:
 There are a few things that could be modified to facilitate spinning
 down the disk. Syslogd is compulsive about writing information to the
 disk right away just in case the system crashes. It could be given an
 option to buffer.

I think it would be best if this option is implemented as a priority
level at which syslogd would sync, for example `crit'.  Messages logged
at lower levels would be unlikely to be followed by a crash.
-- 
Shields, CrossLink.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED]


Tweaking cron for use on laptops

1996-12-10 Thread Karl M. Hegbloom
 Martin == Martin Gallant [EMAIL PROTECTED] writes:

Martin I have been running Debian on my laptop for a few months
Martin now.  Good job guys.  Unless I intentionally remove the
Martin cron package form this machine, the hard drive will not
Martin spin down.  What would be nice is if I could configure
Martin cron to only run say once per hour.  That way I could take
Martin advantage of the log cycling features of the system.
Martin Reading through the vixie cron documentation and source,
Martin there does not appear to be a straightforward way to do
Martin this.  Anyone thought about this?

 I've thought about that  too.  A friend of mine  has a  Thinkpad that
can do  a context dump to  a disk partition, and  start up right where
you leave  off.  He told me  that  there's a  desktop system available
that can go to  sleep like that also.  I  want one!  I'd like to leave
my machine on all the time.

 I've set my  drives to spin down,  using 'hdparm', but 'update' keeps
them from  stopping.  There's a patch out,  called 'atime' patch, if I
recall, that  is  supposed to help alleviate  this.   It says it comes
with a  script that puts /dev/* in  a ramdisk.  I  haven't explored it
yet.

 But what about 'cron'?  It ought  to set an alarm  that would wake up
the computer just before a job is scheduled,  run the job, and then go
back  to sleep.   I suppose  that  a re-implementation  of 'cron'  and
'atrun' would be required to make this happen.   Q: Does the real time
clock have what  would  be  required?  (or  a  start  on  that?)   How
difficult would that  be?   Do those  computer support something  like
this?  They must, it seems such an obvious thing.

 Another thing  I thought  of   is to install  that  screensaver hooks
patch, and  have the screensaver send a  signal to a modified 'update'
daemon.  It could SIGUSER1 it, which would cause it to 'sync' and then
toggle to OFF.  When  the  screensaver deactivates, it would  SIGUSER1
'update' again, and that would toggle  update back on again.  (Perhaps
rather than  ON/OFF, it would toggle between  two update periods given
on the   commandline  toupdate.   A  longer  timeoutfor  while
screenblanker is active.)

 I tried to hack in a call to sync(); where the screen gets blanked in
the kernel, naively.  (Aiieeh!)   Can't schedule during an
interrupt.   After   I  finish   the bigred book, Beginning  Linux
Programming, I  think I will get  that Kernel Internals book and start
on it.  :-)  There's a lot to learn.

 I'm not capable of coding any of that yet; I'm just  a beginner.  But
I've thought about it some...  :-)

--
 Participate in history!
   __ _Karl M. Hegbloom [EMAIL PROTECTED]
  / /(_)_ __  _   ___  __  http://www.inetarena.com/~karlheg
 / / | | '_ \| | | \ \/ /  Portland, OR, USA
/ /__| | | | | |_| | Proudly running Linux 2.0.25 transname
\/_|_| |_|\__,_/_/\_\ and Debian GNU public software!


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED]


Re: Tweaking cron for use on laptops

1996-12-10 Thread Bruce Perens
Martin Unless I intentionally remove the
Martin cron package form this machine, the hard drive will not
Martin spin down.

There are a few things that could be modified to facilitate spinning
down the disk. Syslogd is compulsive about writing information to the
disk right away just in case the system crashes. It could be given an
option to buffer. Cron, as you say, is another candidate. Also, (on a
much longer timeline) there are things that can be done in the filesystems.
For example, the last-accessed time of a file doesn't have to be written
immediately, especially if reading a block from the ram cache. Also, when
a disk is spun down it should be put in the unmounted state - that is
with all modifications committed to disk before it's spun down, and the
mounted bit cleared in the superblock. The first write should set the
mounted bit when it is spun back up.

Martin Anyone thought about this?

I doubt it would be much trouble to hack cron. Go for it.

 From: Karl M. Hegbloom [EMAIL PROTECTED]
 I've thought about that  too.  A friend of mine  has a  Thinkpad that
 can do  a context dump to  a disk partition, and  start up right where
 you leave  off.

Linux can do that on the Thinkpad, and many other laptops, via APM.
It's really a BIOS feature. My desktop will suspend, but the BIOS
doesn't save RAM to disk so the power stays on.

 I've set my  drives to spin down,  using 'hdparm', but 'update' keeps
 them from  stopping.  There's a patch out,  called 'atime' patch, if I
 recall, that  is  supposed to help alleviate  this.   It says it comes
 with a  script that puts /dev/* in  a ramdisk.  I  haven't explored it
 yet.

That's the last-accessed time. I'd rather defer writing that information
until I know the disk is spinning than put the devices in a RAM disk.

 But what about 'cron'?  It ought  to set an alarm  that would wake up
 the computer just before a job is scheduled,  run the job, and then go
 back  to sleep.

Take that 60-second alarm and make it 60 minutes. See what breaks. Fix it.

 Another thing  I thought  of   is to install  that  screensaver hooks
 patch, and  have the screensaver send a  signal to a modified 'update'
 daemon.

Most of what you need is already in the APM driver.

 I tried to hack in a call to sync(); where the screen gets blanked in
 the kernel, naively.  (Aiieeh!)   Can't schedule during an
 interrupt.

But you can ask kerneld to perform a service for you, and then return from
the interrupt. It will get there in a second or two.

Bruce
--
Bruce Perens K6BP   [EMAIL PROTECTED]
Finger [EMAIL PROTECTED] for PGP public key.
PGP fingerprint = 88 6A 15 D0 65 D4 A3 A6  1F 89 6A 76 95 24 87 B3 


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED]


Tweaking cron for use on laptops

1996-12-08 Thread Martin Gallant
I have been running Debian on my laptop for a few months now.  Good job
guys.  Unless I intentionally remove the cron package form this machine,
the hard drive will not spin down.  What would be nice is if I could
configure cron to only run say once per hour.  That way I could take
advantage of the log cycling features of the system.  Reading through
the vixie cron documentation and source, there does not appear to be a
straightforward way to do this.  Anyone thought about this?

 

-- 
Marty


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED]