|
@@ -0,0 +1,314 @@
|
|
|
+#!/bin/rc
|
|
|
+# 9fs filesystem [mountpoint] - srv & mount filesystem, usually from plan 9
|
|
|
+
|
|
|
+rfork e
|
|
|
+arch=/lib/vac/arch # archive mount-point tree
|
|
|
+
|
|
|
+# mount netapp nfs servers
|
|
|
+fn mntnfs { # name homedir-list
|
|
|
+ srvr=$1; shift
|
|
|
+ if (test -e /srv/$srvr.all) {
|
|
|
+ mount -C /srv/$srvr.all /n/$srvr
|
|
|
+ exit
|
|
|
+ }
|
|
|
+ if(! test -f /srv/$srvr)
|
|
|
+ nfs -p 666 -u /lib/ndb/1127.passwd /lib/ndb/1127.group $srvr
|
|
|
+ unmount /n/$srvr >[2]/dev/null
|
|
|
+
|
|
|
+ # print errors only on first mount attempt
|
|
|
+ mount -aC /srv/$srvr /n/$srvr /$1
|
|
|
+ shift
|
|
|
+ for (i)
|
|
|
+ mount -aC /srv/$srvr /n/$srvr /$i >[2]/dev/null
|
|
|
+ rfork n
|
|
|
+ srvfs -p 666 $srvr.all /n/$srvr # mainly for ftpd
|
|
|
+}
|
|
|
+
|
|
|
+fn usage {
|
|
|
+ echo usage: 9fs service '[mountpoint]' >[1=2]
|
|
|
+ exit usage
|
|
|
+}
|
|
|
+
|
|
|
+switch($1){
|
|
|
+case ''
|
|
|
+ usage
|
|
|
+
|
|
|
+# main fs
|
|
|
+case main snap dump other stand
|
|
|
+ 9fs pie$1 && bind /n/pie$1 /n/$1
|
|
|
+case fs
|
|
|
+ 9fs piemain && bind /n/piemain /n/$1
|
|
|
+case fsother
|
|
|
+ 9fs pieother && bind /n/pieother /n/$1
|
|
|
+
|
|
|
+case pie
|
|
|
+ srv -q pie && mount -cC /srv/pie /n/$1 main/active
|
|
|
+case piemain
|
|
|
+ srv -q pie && mount -cC /srv/pie /n/$1 main/active
|
|
|
+case piedump
|
|
|
+ srv -q pie && mount -C /srv/pie /n/$1 main/archive
|
|
|
+ 9fs archive
|
|
|
+ bind -a $arch/emelie /n/$1
|
|
|
+ bind -a $arch/emelie/2003 /n/$1/2003
|
|
|
+ bind -b $arch/bootes /n/$1
|
|
|
+case piesnap
|
|
|
+ srv -q pie && mount -C /srv/pie /n/$1 main/snapshot
|
|
|
+case piestand
|
|
|
+ srv -q -cC net!pie!10564 $1 && mount -cC /srv/$1 /n/$1 main/active
|
|
|
+case piestanddump
|
|
|
+ srv -q -cC net!pie!10564 $1 && mount -cC /srv/$1 /n/$1 main/archive
|
|
|
+case pieother
|
|
|
+ srv -q -cC net!pie!20564 $1 && mount -cC /srv/$1 /n/$1 main/active
|
|
|
+
|
|
|
+# previous fs
|
|
|
+case yoshimi
|
|
|
+ srv -q yoshimi && mount -cC /srv/yoshimi /n/$1 main/active
|
|
|
+case yoshimimain
|
|
|
+ srv -q yoshimi && mount -cC /srv/yoshimi /n/$1 main/active
|
|
|
+case yoshimidump
|
|
|
+ srv -q yoshimi && mount -C /srv/yoshimi /n/$1 main/archive
|
|
|
+ 9fs archive
|
|
|
+ bind -a $arch/emelie /n/$1
|
|
|
+ bind -a $arch/emelie/2003 /n/$1/2003
|
|
|
+ bind -b $arch/bootes /n/$1
|
|
|
+case yoshimisnap
|
|
|
+ srv -q yoshimi && mount -C /srv/yoshimi /n/$1 main/snapshot
|
|
|
+case yoshimistand
|
|
|
+ srv -q -cC net!yoshimi!10564 $1 && mount -cC /srv/$1 /n/$1 main/active
|
|
|
+case yoshimistanddump
|
|
|
+ srv -q -cC net!yoshimi!10564 $1 && mount -cC /srv/$1 /n/$1 main/archive
|
|
|
+case yoshimiother
|
|
|
+ srv -q -cC net!yoshimi!20564 $1 && mount -cC /srv/$1 /n/$1 main/active
|
|
|
+
|
|
|
+# previous previous file server
|
|
|
+case edith
|
|
|
+ srv -q edith && mount -cC /srv/edith /n/$1 main/active
|
|
|
+case edithmain
|
|
|
+ srv -q edith && mount -C /srv/edith /n/$1 main
|
|
|
+case edithdump
|
|
|
+ srv -q edith && mount -C /srv/edith /n/$1 main/archive
|
|
|
+case edithsnap
|
|
|
+ srv -q edith && mount -C /srv/edith /n/$1 main/snapshot
|
|
|
+case edithroot
|
|
|
+ srv -q -cC net!edith!10564 $1 && mount -cC /srv/$1 /n/$1 main/active
|
|
|
+case edithrootdump
|
|
|
+ srv -q -cC net!edith!10564 $1 && mount -cC /srv/$1 /n/$1 main/archive
|
|
|
+case edithother
|
|
|
+ srv -q -cC net!edith!20564 $1 && mount -cC /srv/$1 /n/$1 main/active
|
|
|
+case edithotherro
|
|
|
+ srv -q -cC net!edith!30564 $1 && mount -cC /srv/$1 /n/$1 main/active
|
|
|
+
|
|
|
+# the old jukeboxes' contents
|
|
|
+case archive bootes bootesdump fornax fornaxdump \
|
|
|
+ emelie emeliedump choline cholinedump jukes
|
|
|
+ mount -C /srv/jukes /n/jukes >[2]/dev/null || {
|
|
|
+ unmount /n/jukes >[2]/dev/null
|
|
|
+ rm -f /srv/jukes
|
|
|
+ if (~ $sysname pie)
|
|
|
+ vacfs -h localhost -S jukes /lib/vac/jukes.vac
|
|
|
+ if not {
|
|
|
+# import -C -s jukes pie /n/jukes
|
|
|
+# chmod +rw /srv/jukes >[2]/dev/null
|
|
|
+ import pie / /n/pie &&
|
|
|
+ mount -C /n/pie/srv/jukes /n/jukes
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (! test -d /n/jukes/choline) {
|
|
|
+ mount -C /srv/jukes /n/jukes || exit 'can''t mount /srv/jukes'
|
|
|
+ if (! test -d /n/jukes/choline) {
|
|
|
+ echo $0: /n/jukes/choline missing! >[1=2]
|
|
|
+ exit no-choline
|
|
|
+ }
|
|
|
+ }
|
|
|
+ bind /n/jukes/bootes/1997/1231 /n/bootes
|
|
|
+ bind /n/jukes/fornax/1997/1231 /n/fornax
|
|
|
+ bind /n/jukes/emelie/2006/10301 /n/emelie
|
|
|
+ bind /n/jukes/choline/2006/0814 /n/choline
|
|
|
+
|
|
|
+ for (juke in bootes fornax emelie choline) {
|
|
|
+ bind /n/jukes/$juke /n/$juke^dump
|
|
|
+ # backward compatibility
|
|
|
+ bind /n/jukes/$juke $arch/$juke^dump
|
|
|
+ # should this be one of the above binds of a date?
|
|
|
+ bind /n/jukes/$juke $arch/$juke
|
|
|
+ }
|
|
|
+ bind $arch /n/archive # backward compatibility
|
|
|
+case audio
|
|
|
+ bind -a /sys/lib/music /lib/audio/maps
|
|
|
+
|
|
|
+case kfs
|
|
|
+ if(! test -f /srv/kfs)
|
|
|
+ disk/kfs
|
|
|
+ mount -cC /srv/kfs /n/kfs
|
|
|
+case localhost
|
|
|
+ srv -mC localhost
|
|
|
+
|
|
|
+# the inside/outside border
|
|
|
+case boundary lookout
|
|
|
+ # permissions need to work and they don't with srv
|
|
|
+ exec import -C $1 / /n/$1
|
|
|
+# exec importsrv $1
|
|
|
+
|
|
|
+#
|
|
|
+# the outside world
|
|
|
+#
|
|
|
+
|
|
|
+# outside venti & fossil server
|
|
|
+case outfs
|
|
|
+ srv -q outfs && mount -cC /srv/outfs /n/$1 main/active
|
|
|
+case outfsdump
|
|
|
+ srv -q outfs && mount -C /srv/outfs /n/$1 main/archive
|
|
|
+case outfssnap
|
|
|
+ srv -q outfs && mount -C /srv/outfs /n/$1 main/snapshot
|
|
|
+case outfsmain
|
|
|
+ srv -q -cC net!outfs!10564 $1 && mount -cC /srv/$1 /n/$1 main/active
|
|
|
+
|
|
|
+# new outside fossil server
|
|
|
+case bovril
|
|
|
+ srv -q bovril && mount -cC /srv/bovril /n/$1 main/active
|
|
|
+case bovrildump
|
|
|
+ srv -q bovril && mount -C /srv/bovril /n/$1 main/archive
|
|
|
+case bovrilsnap
|
|
|
+ srv -q bovril && mount -C /srv/bovril /n/$1 main/snapshot
|
|
|
+case bovrilmain
|
|
|
+ srv -q -cC net!bovril!10564 $1 && mount -cC /srv/$1 /n/$1 main/active
|
|
|
+
|
|
|
+# other outside machines, mostly legacy
|
|
|
+case outside outside.cs.bell-labs.com
|
|
|
+ exec import -C net!outside.cs.bell-labs.com!666 / /n/outside
|
|
|
+# exec importsrv net!outside!666 /n/$1
|
|
|
+case outside-norm
|
|
|
+ srv -q outside && mount -cC /srv/outside /n/$1 main/active
|
|
|
+case noutside noutside.cs.bell-labs.com
|
|
|
+ exec import -C net!noutside.cs.bell-labs.com!666 / /n/noutside
|
|
|
+# exec importsrv net!noutside!666 /n/$1
|
|
|
+case noutside-norm
|
|
|
+ srv -q noutside && mount -cC /srv/noutside /n/$1 main/active
|
|
|
+case noutsidedump
|
|
|
+ 9fs noutside && mount -cC /srv/noutside /n/$1 main/archive
|
|
|
+case wiki
|
|
|
+ srv -q 'tcp!noutside!wiki' wiki
|
|
|
+ mount /srv/wiki /mnt/wiki
|
|
|
+case dusty scummy grubby
|
|
|
+ unmount /n/^$1 >/dev/null >[2]/dev/null
|
|
|
+ srv -m $1^.research.bell-labs.com $1 /n/^$1 && mount -c /srv/^$1 /n/^$1
|
|
|
+case gridroot
|
|
|
+ import -C a.grid.bell-labs.com / /n/gridroot
|
|
|
+case grid
|
|
|
+ srv -mC a.grid.bell-labs.com grid /n/grid
|
|
|
+case martha # martha local fossil
|
|
|
+ exec import -C sources.cs.bell-labs.com / /n/martha
|
|
|
+case sources # martha network fossil
|
|
|
+ srv -mC net!sources!9fs sources /n/sources
|
|
|
+ if (! ~ $status '') {
|
|
|
+ rm -f /srv/sources
|
|
|
+ srv -mC net!sources!9fs sources /n/sources
|
|
|
+ }
|
|
|
+ # /n/sources is too much typing and /n/sources/plan9 is worse
|
|
|
+ bind /n/sources /n/src
|
|
|
+ if (test -e /n/src/plan9)
|
|
|
+ bind /n/src/plan9 /n/p9
|
|
|
+case sourcesdump
|
|
|
+ 9fs sources && mount -C /srv/sources /n/$1 main/archive
|
|
|
+case sourcessnap
|
|
|
+ 9fs sources && mount -C /srv/sources /n/$1 main/snapshot
|
|
|
+
|
|
|
+#
|
|
|
+# netapp nfs servers
|
|
|
+#
|
|
|
+case home
|
|
|
+ 9fs slocum && bind /n/slocum/home /n/home
|
|
|
+case prometheus
|
|
|
+ srv -mcC prometheus.research.bell-labs.com
|
|
|
+ bind /n/prometheus.research.bell-labs.com /n/prometheus
|
|
|
+case cm
|
|
|
+ unix=slocum
|
|
|
+ if (! test -e /n/cm/index.html) {
|
|
|
+ if (! 9fs $unix) {
|
|
|
+ rm -f /srv/$unix
|
|
|
+ 9fs $unix
|
|
|
+ }
|
|
|
+ bind /n/$unix/n/hale/h003/u0/cm /n/cm && {
|
|
|
+ rm -f /srv/cm
|
|
|
+ srvfs -p 666 cm /n/cm
|
|
|
+ }
|
|
|
+ }
|
|
|
+case bopp
|
|
|
+ # v8 first to make rae visible
|
|
|
+ mntnfs $1 (v8 a0 b302 shome su0 su2 su3 v^(1 2 3 4 5 6 7 9) \
|
|
|
+ u^(0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j y z))
|
|
|
+case hale
|
|
|
+ mntnfs $1 (h002 h003 h101 h103 h104)
|
|
|
+case scone
|
|
|
+ mntnfs $1 (scone^(0 1 2 3 4))
|
|
|
+case washer
|
|
|
+ mntnfs $1 (vol)
|
|
|
+
|
|
|
+# arbitrary venti archives
|
|
|
+case vac:*
|
|
|
+ vacfs <{echo $1}
|
|
|
+case vac.*
|
|
|
+ vacfs -m /n/$1 <{echo $1 | sed 's/vac\./vac:/'}
|
|
|
+case oldlog
|
|
|
+ vacfs -m /n/$1 `{sed 1q `{ls -t /sys/log/vac/[12]???.vac}}
|
|
|
+
|
|
|
+case log
|
|
|
+ 9fs boot
|
|
|
+ bind /n/boot/sys/log /sys/log
|
|
|
+ for (fsys in boundary lookout stand outfs) {
|
|
|
+ 9fs $fsys && bind -a /n/$fsys/sys/log /sys/log
|
|
|
+ }
|
|
|
+
|
|
|
+case coraid
|
|
|
+ srv -mc net!devi!10564 coraid /n/coraid
|
|
|
+
|
|
|
+# misc. unix machines
|
|
|
+case album
|
|
|
+ 9fs album.research.bell-labs.com &&
|
|
|
+ bind /n/album.research.bell-labs.com /n/album
|
|
|
+case slocum
|
|
|
+ 9fs slocum.research.bell-labs.com &&
|
|
|
+ bind /n/slocum.research.bell-labs.com /n/slocum
|
|
|
+case slocum-ssh
|
|
|
+ sys=slocum
|
|
|
+ exec srvssh -u u9fs net!$sys.research.bell-labs.com $sys /n/$sys
|
|
|
+case slocum-big
|
|
|
+ exec srvssh -u /home/geoff/bin/IP27.IRIX64/u9fs \
|
|
|
+ slocum $1 /n/slocum
|
|
|
+case geoff-x60 geoff-x60-50 brunei soekris1 db-security
|
|
|
+ exec srvssh -u /usr/local/bin/u9fs $1 $1 /n/$1
|
|
|
+case freebsd
|
|
|
+# exec srvssh $1 $1 /n/$1
|
|
|
+ exec srvssh -u /home/geoff/bin/386/u9fs $1 $1 /n/$1
|
|
|
+case saras65k wolverine wraith
|
|
|
+ exec srvssh -u /home/geoff/bin/sparc/u9fs $1 $1 /n/$1
|
|
|
+case ipv6 vfw vfw-out outfw ethel
|
|
|
+ exec srvssh -u u9fs net!$1.cs.bell-labs.com $1 /n/$1
|
|
|
+# at home
|
|
|
+case geoff-fw
|
|
|
+ exec srvssh -u /usr/local/bin/u9fs /net.alt/net!10.0.0.2 fw /n/fw
|
|
|
+case geoff-mac
|
|
|
+ exec srvssh -u /usr/local/bin/u9fs /net.alt/net!10.0.10.2 mac /n/mac
|
|
|
+# at work
|
|
|
+case geoff-fw-ext
|
|
|
+ exec srvssh -u /usr/local/bin/u9fs /net.alt/net!fw-fios.collyer.net fw /n/fw
|
|
|
+
|
|
|
+# general case
|
|
|
+case *
|
|
|
+ switch($#*){
|
|
|
+ case 1
|
|
|
+ exec srv -mc $1
|
|
|
+ case *
|
|
|
+ exec srv -mc $1 $1 $2
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+# only special cases recognised above get here
|
|
|
+switch($#*){
|
|
|
+case 1
|
|
|
+ ;
|
|
|
+case 2
|
|
|
+ bind /n/$1 $2
|
|
|
+case *
|
|
|
+ usage
|
|
|
+}
|