9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] redirfs updated on sources
@ 2003-05-07 15:10 Fco.J.Ballesteros
  0 siblings, 0 replies; only message in thread
From: Fco.J.Ballesteros @ 2003-05-07 15:10 UTC (permalink / raw)
  To: 9fans

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.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-07 15:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-07 15:10 [9fans] redirfs updated on sources Fco.J.Ballesteros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).