From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5cb5f6df253349c9c1a419819cd76fb5@plan9.escet.urjc.es> To: 9fans@cse.psu.edu From: Fco.J.Ballesteros MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] redirfs updated on sources Date: Wed, 7 May 2003 17:10:04 +0200 Topicbox-Message-UUID: a2634072-eacb-11e9-9e20-41e7f4b1d025 Hi, after using redirfs for some time and fixing some bugs I found (the hard way), I've just copied to /n/sources/nemo the last version of redirfs(4) (manual page included). I use it like this (to switch to different file servers and to failover if suffering network problems): [user processes] <-> [redirfs] <-> both [kfs] and [file server] The idea is that I boot from kfs, setting a redir variable in plan9.ini. When termrc notices the variable, it starts redirfs to sit between the kfs and the user; termrc also lets redirfs know that our file server machine also has those files and that they are our preferred ones. This means that we start using the files from the file server as we do when we boot off the network. However, if the network fails (or we disconnect), redirfs fails over to the kfs. We can later ask it to start using the file server again. Instead of redirecting / (as we did before), we now redirect /386 /acme /adm /cron /lib /rc /sys /usr and /dist. This is to avoid redirections on /mail, which has DMEXCL files that should not be kept open for too long. This is the part of termrc that performs the redirection: # redirs is set to (386 acme adm cron lib rc sys usr dist) # in some other place if ( ~ $redir yes && test -x /boot/redirfs ) { # setup redirections to mount aquamar echo 'redirecting ' /^$redirs auth/secstore -G factotum | read -m >/mnt/factotum/ctl for (dir in $redirs){ # start redirector (it uses the local kfs by now) # tell about the file server # set it as the preferred one # and start using it /boot/redirfs -c -s $dir^fs -m /$dir /$dir echo 9fs $dir^fs!aquamar aquamar /$dir >> /srv/$dir^fs.cmd echo score $dir^fs!aquamar 0 >> /srv/$dir^fs.cmd echo Set >> /srv/$dir^fs.cmd } # these file trees are special for us import -c aquamar /mail/box bind -c /n/kfs/sys/log /sys/log 9fs once } If any of you wants to use this thing, I'd be happy to help. BTW, I'm experimenting with another boot method in boot(8) to automate the start of redirfs, so that if you say local tcp as your boot method (both things), a redirector is started to use any of both servers. The aim is to get rid of the bunch of termrc that I pasted above. Any comment/critic is welcome.