72 lines · 2.5 KB · Text
RawDownload
Provides GNU screen-like functionality via a 9p fs of io Hubs.Use the hub wrapper script to start the hubfs and hubshell. STARTING AND CONNECTING WITH 'HUB' WRAPPER SCRIPThub aug5 #starts and connects to a new hubfs and posts /srv/aug5hub aug5 #connects a new client to the rc shell started by the previous commandhub aug5 rctwo #starts and connects to new rc named rctwo within the aug5 hubfshub #starts a hubfs named hubfs with an rc named iohub #connects to the default hubfs io MAKING NEW SHELLS AND MOVING IN HUBSHELL:-all commands begin with '%' as first character-%detach  #disconnect from attached shell%remote NAME #start a new shell on remote machine%local NAME #start a new shell on local machine shared to hubfs server%attach NAME #move to an existing hubfs shell%err TIME, %in TIME, %out TIME #time in ms for delay loop on file access%status #basic hubfs connection info%list #lc of connected hubfs hubs CONTROLLING HUBFS ITSELF VIA CTL FILE:-reading from ctl file returns status-echo freeze >/n/hubsrv/ctl #freeze Hubs as static files for viewing and editingecho melt >/n/hubsrv/ctl #resume normal flow of dataecho fear >/n/hubsrv/ctl #activate paranoid mode and fswrites wait for fsreads to output dataecho calm >/n/hubsrv/ctl #resume standard non-paranoid data transmission modeecho quit >/n/hubsrv/ctl #bring everything to a crashing halt and kill the fs NOTES:Each rc shell makes use of 3 Hubs, one for each file descriptor.A Hub file provides both input and output.You can create additional freeform pipelines by touching files to create Hubs. SCRIPTS FOR USE FROM P9P/UNIX:I use 9pfuse in combination with a one-connection listener from plan9and two tiny scripts to let me access plan 9 hubfs shells from linuxand share linux shells back to plan9.  Here is an example sequence: plan9: hub -b linhubmount -c /srv/linhub /n/linhubtouch /n/linhub/lin0touch /n/linhub/lin1touch /n/linhub/lin2aux/listen1 -tv tcp!*!19999 /bin/exportfs -r /n/linhub # non-authed listen1 will be open for a few seconds, monitor -v output linux: mkdir hubfs9pfuse 'tcp!ip.of.hub.server!19999' hubfsputhub hubfs/lingethub hubfs/io This results in a linux shell being shared back to the hubfs at lin,and a plan9 shell accessible to the linux machine.  At this point thelisten1 command on plan9 can and should be terminated, it is notneeded after the connection is made.  gethub and puthub scripts: #!/bin/bash# puthub pathrc -i <$1"0" >>$1"1" 2>>$1"2" & #!/bin/bash# gethub pathcat $1"1" &cat $1"2" &cat >>$1"0"kill %1kill %2