From: Xiao-Yong Jin <meta.jxy@gmail.com>
To: 9front@9front.org
Subject: Re: [9front] cfs, aan and network recommendations
Date: Mon, 15 Nov 2021 22:12:53 -0600 [thread overview]
Message-ID: <88E487A2-AF64-4B12-8949-3C951CB099CE@gmail.com> (raw)
In-Reply-To: <ed7e4ca5-3c15-4f8b-a0ec-56e9760fdefc@sirjofri.de>
> On Nov 15, 2021, at 4:39 PM, sirjofri <sirjofri+ml-9front@sirjofri.de> wrote:
>
> Did anyone try something like that? How reliable is aan? I know it handles short interruptions reasonably well (e.g. switching between LTE and WiFi), but what if something more happens? How could I handle potential rebooting (do I need to reboot oat each time I reboot leaf then)?
Aan server and client has to sync up. If you reboot the server,
you have to reboot the client. Otherwise aan is stable, though
slow. Cfs+aan is even slower, though I never understood the reason.
I copy commonly used binaries locally to the client /tmp and bind
them in place, and use disk/mkfs to keep those up to date. Aan
also does not work with tls boot out of the box. I put my patch
below (some may not be necessary). Though perhaps it would just
be easier if you maintain a full local copy of files in the client.
diff a4c1f3cc18df6fddd548f4df9f209695c4eb7263 uncommitted
--- a/rc/bin/rconnect
+++ b/rc/bin/rconnect
@@ -3,8 +3,9 @@
argv0=$0
aanto=86400 #one day
+aanport=0
fn usage {
- echo 'usage:' $argv0 '[-u user] [-k keypattern] [-p] [-t timeout] host remotescript localcommand arg ...' >[1=2]
+ echo 'usage:' $argv0 '[-u user] [-k keypattern] [-p] [-t timeout] [-P aanport] host remotescript localcommand arg ...' >[1=2]
exit 'usage'
}
@@ -27,6 +28,7 @@
case -k; keyspec=($keyspec $2)
case -u; keyspec=($keyspec `{user=$2 pvar user})
case -t; aanto=$2
+ case -P; aanport=$2
case *; usage
}
shift
@@ -50,11 +52,12 @@
fn aanserver {
~ $#netdir 1 || netdir=/net/tcp/clone
netdir=`{basename -d $netdir} || exit
- <>$netdir/clone {
- netdir=$netdir/`{read} || exit
+ <>[4]$netdir/clone {
+ netdir=$netdir/`{read <[0=4]} || exit
>[3] $netdir/ctl {
- echo -n 'announce *!0' >[1=3]
+ echo -n 'announce *!'$aanport >[1=3] || exit
echo `{cat $netdir/local} || exit
+ ~ `{read} OK || exit
bind '#|' /mnt/aan || exit
exec aan -m $aanto $netdir <>/mnt/aan/data1 >[1=0] >[2]/dev/null &
}
@@ -63,7 +66,7 @@
rfork n
fn server {
echo -n aanserver $netdir >/proc/$pid/args
- rm -f /env/^('fn#server' 'fn#aanserver' 'aanto')
+ rm -f /env/^('fn#server' 'fn#aanserver' 'aanto' 'aanport')
. <{n=`{read} && ! ~ $#n 0 && read -c $n} >[2=1]
}
exec tlssrv -A /bin/rc -c server
@@ -72,9 +75,10 @@
}
fn aanclient {
host=`{echo $host | sed 's/(.*)!([^!]+)$/\1/'}^!^`{read | sed 's/(.*)!([^!]+)$/\2/'} || exit
+ echo OK || exit
tlsclient -a -o <>{rfork s; aan -m $aanto -c $host >[1=0]} /bin/rc -c 'sendscript $*' $*
}
- exec $argv0 -k $"keyspec $host <{builtin whatis aanserver; pvar aanto; echo aanserver} aanclient $*
+ exec $argv0 -k $"keyspec $host <{builtin whatis aanserver; pvar aanto; pvar aanport; echo aanserver} aanclient $*
exit
}
--- a/rc/bin/rcpu
+++ b/rc/bin/rcpu
@@ -11,7 +11,7 @@
mount -nc /fd/0 /mnt/term || exit
bind -q /mnt/term/dev/cons /dev/cons
</mnt/term/fd/10 >/mnt/term/fd/11 >[2]/mnt/term/fd/12 {
- ~ $#dir 0 || cd $"dir || echo 'can''t change directory: '^$"dir >[1=2]
+ ~ $#dir 0 || cd $"dir >/dev/null >[2=1]
switch($#cmd){
case 0; cmd=(rc -li)
case 1; cmd=(rc -lc $cmd)
--- a/rc/bin/rimport
+++ b/rc/bin/rimport
@@ -3,7 +3,7 @@
argv0=$0
fn usage {
- echo 'usage:' $argv0 '[-abcCnq] [-s name] [-u user] [-k keypattern] [-p] [-t timeout] host tree [mountpoint]' >[1=2]
+ echo 'usage:' $argv0 '[-abcCnq] [-s name] [-u user] [-k keypattern] [-p] [-t timeout] [-P aanport] host tree [mountpoint]' >[1=2]
exit 'usage'
}
@@ -29,7 +29,7 @@
case *
~ $#* 1 && usage
switch($1){
- case -[ukt]; connect=($connect $1 $2)
+ case -[uktP]; connect=($connect $1 $2)
case -s; sname=`{basename $2}
case *; usage
}
--- a/sys/src/9/boot/bootfs.proto
+++ b/sys/src/9/boot/bootfs.proto
@@ -1,6 +1,7 @@
$objtype
bin
9660srv
+ aan
awk
auth
secstore
@@ -32,6 +33,7 @@
dnsgetip
hjfs
rc
+ read
rm
sed
sleep
@@ -44,6 +46,7 @@
ether
disk
kb
+ wc
xd
rc
lib
@@ -55,6 +58,7 @@
fstype
diskparts
srvtls
+ srvtlsaan
nusbrc 555 sys sys ../boot/nusbrc
bootrc 555 sys sys ../boot/bootrc
tmp
--- a/sys/src/9/boot/net.rc
+++ b/sys/src/9/boot/net.rc
@@ -65,19 +65,25 @@
}
fn connecttcp{
- while(! ~ $#fs 0 && ! srv -q tcp!$fs(1)^!564 boot)
+ while(! ~ $#fs 0 && ! srv -q $srvopt tcp!$fs(1)^!564 boot)
fs=$fs(2-);
fs=$fs(1)
}
fn connecttls{
- while(! ~ $#fs 0 && ! srvtls -q tcp!$fs(1)^!17020 boot)
+ while(! ~ $#fs 0 && ! srvtls -q $srvopt tcp!$fs(1)^!17020 boot)
fs=$fs(2-);
fs=$fs(1)
}
+fn connecttlsaan{
+ while(! ~ $#fs 0 && ! srvtlsaan -q $srvopt tcp!$fs(1)^!17019 boot)
+ fs=$fs(2-);
+ fs=$fs(1)
+}
+
fn connectil{
- while(! ~ $#fs 0 && ! srv -q il!$fs(1)^!17008 boot)
+ while(! ~ $#fs 0 && ! srv -q $srvopt il!$fs(1)^!17008 boot)
fs=$fs(2-);
fs=$fs(1)
}
@@ -84,6 +90,7 @@
mtcp=(confignet connecttcp)
mtls=(confignet connecttls)
+mtlsaan=(confignet connecttlsaan)
mil=(confignet connectil)
-mt=(mtcp mtls mil $mt)
+mt=(mtcp mtls mtlsaan mil $mt)
--- a/sys/src/cmd/aan.c
+++ b/sys/src/cmd/aan.c
@@ -357,10 +357,6 @@
err[0] = '\0';
errstr(err, sizeof err);
- if (strstr(err, "connection refused")) {
- if(debug) fprint(2, "reconnect; server died...\n");
- threadexitsall("server died...");
- }
if(debug) fprint(2, "reconnect: dialed %s; %s\n", dialstring, err);
sleep(1000);
}
next prev parent reply other threads:[~2021-11-17 9:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-15 22:39 sirjofri
2021-11-16 4:12 ` Xiao-Yong Jin [this message]
2021-11-16 18:18 ` Noam Preil
2021-11-16 19:04 ` Steve Simon
2021-11-17 1:51 ` hiro
2021-11-17 7:31 ` sirjofri
2021-11-17 9:45 ` hiro
2021-11-17 10:31 ` sirjofri
2021-11-17 15:31 ` hiro
2021-11-18 22:05 ` Steve Simon
2021-11-18 23:21 ` hiro
2021-11-17 21:35 ` sirjofri
2021-11-17 22:12 ` hiro
2021-11-17 22:52 ` Steve Simon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=88E487A2-AF64-4B12-8949-3C951CB099CE@gmail.com \
--to=meta.jxy@gmail.com \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).