Jun 08, '06 07:30:00AM • Contributed by: Anonymous
By unmounting your network shares just before sleep, your system won't have to deal with lost connections when it wakes up. Additionally, when your system wakes up, the sleepwatcher daemon will run your wakeup script, which can remount your network shares. sleepwatcher daemon Here are the steps:
- Install sleepwatcher.
- Make a shell script in your home directory named .sleep. I just unmount my network mounts in this script. Make sure you chmod it to at least 700; 755 is OK, too. Here's the script:
logger -t sleepwatcher "unmounting serv" umount /Network/Servers/servh/data - Make a shell script in your home directory named .wakup. Since this script might run before the network comes back up, I use a trick to pipe the command to a backgrounded bash prompt with a sleep 10 command. chmod this one to 700 or 755 as well:
echo 'sleep 10 logger -t sleepwatcher "remounting serv" ls /Network/Servers/servh/data' | /bin/sh&
