Plan 9 from Bell Labs’s /usr/web/sources/contrib/nemo/octopus/port/pcrc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/dis/sh -n

# Start script for octopus PC

load std
echo 1 >/dev/jit
dom=lsub.org
sysname=`{cat /dev/sysname}
user=`{cat /dev/user}

ndb/dns
ndb/cs
or {ftest -f /keydb/signerkey} {echo 'auth: need to use createsignerkey(8)' >[1=2]; exit nosignerkey}
or {ftest -f /keydb/keys} {echo 'auth: need to create /keydb/keys' >[1=2]; exit nokeys}
auth/keyfs -n /keydb/nvr

PC=$sysname.$dom
pcip=`{ndb/dnsquery $PC | sed 's/.*ip	//'}
mkdir -p /term /pc /devs /devs/pc

echo starting octopus PC $PC at $pcip >>[2]/n/log/octopus
echo listening for inflogin, infkey, infsigner, infcsinger, styx, op, rop, ...
listen -v -t -A 'tcp!*!inflogin' {auth/logind>>[2]/n/log/octopus& }
listen -v -t -A 'tcp!*!infkey' {auth/keysrv>>[2]/n/log/octopus&}
listen -v -t -A 'tcp!*!infsigner' {auth/signer>>[2]/n/log/octopus&}
listen -v -t -A 'tcp!*!infcsigner' {auth/countersigner>>[2]/n/log/octopus&}
listen -tv 'tcp!*!styx' {export /pc>>[2]/n/log/octopus&}

bind -c '#₪' /srv
9srvfs pc / &

listen -tv 'tcp!*!op' {o/oxport /pc >>[2]/n/log/octopus&}
listen -tv 'tcp!*!rop' {o/ofs -A -m auto /fd/0 >>[2]/n/log/octopus&}
echo starting registry
svc/registry>>[2]/n/log/octopus
auth/keyfs -n /keydb/nvr	# registry gets rid of it. relaunch
plumber >>[2]/n/log/octopus
o/ports -m /devs/ports
o/watcher -v -t 120 >>[2]/n/log/octopus
echo '^(arrived|gone):.*' >>/devs/ports/terms
{ while { x=`{read </devs/ports/terms} } {o/newterm $x >>/n/log/octopus} } &

# local services. Customize per-user
bind -ac /dis/o/$emuhost /dis/o
sysname=pc
bind -c /term /term
mkdir -p /term/^(what where who music view voice print mail fs prog)
bind -c /n/planb/what /term/what
bind -c /n/planb/where /term/where
bind -c /n/planb/who /term/who
bind -c /n/music /term/music
bind -c /n/local/mail/box/$user /term/mail
bind -c '#U*' /term/fs
bind -c '#p' /term/prog
o/netget -r /mnt/registry what 'path /what' who 'path /who' where 'path /where' music 'path /music' mail 'path /mail' fs 'path /fs'

bind -c /term /devs/pc
bind -c '#U' /pc
bind -c /devs /pc/devs
bind -c /mnt /pc/mnt

wm/sh -n

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].