Subject: Re: Who's accessing my disk?
To: None <current-users@netbsd.org>
From: Wolfgang Rupprecht <wolfgang@wsrcc.com>
List: current-users
Date: 02/07/1999 07:28:47
jmarin@pyy.jmp.fi (Jukka Marin) writes:
> So, as far as I understand, using async mount is currently the only
> way to keep the disk sleeping.

You could also hunt down and kill update when you go into battery
saving mode.  Here is what I use.

What would be ideal would be a disk spin-up hook that could be called
to do a sync() whenever the disks power up.

#!/bin/sh
# $Id: battery,v 1.5 1998/12/04 09:02:11 wolfgang Exp $

logger -i -t battery -p daemon.info "on battery called"

# mount -u -o async,noatime,nodevmtime /

mount -u -o noatime /
mount -u -o noatime /usr
mount -u -o noatime /var
mount -u -o noatime /u

atactl wd0 setidle 5

if [ -f /var/run/cron.pid ]
then
	kill -TERM $(cat /var/run/cron.pid)
fi

kill -TERM $(ps -ax | grep update | grep ' ?? ' | awk '{ print $1 }')

#
# end
#


-- 
       Wolfgang Rupprecht <wolfgang+gnus@dailyplanet.wsrcc.com>
		    http://www.wsrcc.com/wolfgang/
Get DGPS signals over IP.  http://www.wsrcc.com/wolfgang/gps/dgps-ip.html