From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17227 invoked from network); 17 Nov 2021 09:47:29 -0000 Received: from 4ess.inri.net (216.126.196.42) by inbox.vuxu.org with ESMTPUTF8; 17 Nov 2021 09:47:29 -0000 Received: from mail-io1-f47.google.com ([209.85.166.47]) by 4ess; Mon Nov 15 23:13:02 -0500 2021 Received: by mail-io1-f47.google.com with SMTP id w22so24329693ioa.1 for <9front@9front.org>; Mon, 15 Nov 2021 20:12:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=Q/kfuYUCt8dib8+sDgs4xgc71hL4Vy7HLs2fdbii1Kg=; b=XYqjUJrdqAAJV5hAdGew/3mE4y11CXas3E+itiA6KcFuceIzfS2y5JKwbZLp1vYmq2 XYUwBwT2iIhb6+gQKaM0P9Eks8ayFXSb/ZwkGOthFgdEW0KN3bg1jmRWMDp6p4Gx23mO xbqMGJFYBehIk1aPqkclIniAmOArumHXx5UmZZ1MsjhGvPVwuv+fAv20aNPwI2P/7YIZ z8hAWftWE4dyn3yaqGy9RD1OfghUyAYqM0j2P9xdIrOWoyH3Va0FvcczcYfsrTIwQ1cp zsPpRCJ2v5nBdqKIhXS/H2lO+2bMDjS/PW9iW8DqDMaYAEt+sZZuL+/zVOFpFxXgeiWf FXaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=Q/kfuYUCt8dib8+sDgs4xgc71hL4Vy7HLs2fdbii1Kg=; b=pR83xo/OKZDb02MUfPIHBrs06QnGezJdoVm18g46cGMYOu6sfXJd0s3mW5Tv9MgDPK KvR7qCWeQOwyeDQEKppjYaSkTl8dn0ojAYGxDPDV9QS74mg4PvMZJ4FrdNGSKBfLGiwZ WTRjfHIieQRwrQTM6U0T73dr0i74vdUoo+BrOw2Cqd5MtwXECymOHS8ITKo8a4svXfur yrkgYSAv2AOLRSkAtHL2At21toIaBFRuWRbNTsT5/xKYNZCaxYlxNI6VFHwUkpvg3aXp oOpgLlAYJoN4L4u/e/Dv7W4rKBA8aJvXRuxF5ckvN7Lbnp+behP67eC7jUsYyXSqOPWO etQg== X-Gm-Message-State: AOAM531G1i8O4RhYUDM2Go0+t1B8z2Lx8PBG5CgOu3YxFsf2elBS2GcB 9kkvMq7qInzrjuinqbfqlBUJk103MEQ= X-Google-Smtp-Source: ABdhPJyksupVFHzryewjBCNBu1MxZeNMuMwDN/yC7vPVibtMzGyekQ7Nwh9fOoiI7M2tMIvV8bXjZQ== X-Received: by 2002:a05:6602:18e:: with SMTP id m14mr2852123ioo.126.1637035974859; Mon, 15 Nov 2021 20:12:54 -0800 (PST) Return-Path: Received: from smtpclient.apple (c-67-184-39-205.hsd1.il.comcast.net. [67.184.39.205]) by smtp.gmail.com with ESMTPSA id a4sm10494513ild.52.2021.11.15.20.12.54 for <9front@9front.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Nov 2021 20:12:54 -0800 (PST) From: Xiao-Yong Jin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\)) Date: Mon, 15 Nov 2021 22:12:53 -0600 References: To: 9front@9front.org In-Reply-To: Message-Id: <88E487A2-AF64-4B12-8949-3C951CB099CE@gmail.com> X-Mailer: Apple Mail (2.3693.20.0.1.32) List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: webscale session WEB2.0 over TOR strategy information optimizer Subject: Re: [9front] cfs, aan and network recommendations Reply-To: 9front@9front.org Precedence: bulk > On Nov 15, 2021, at 4:39 PM, sirjofri = wrote: >=20 > 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 @@ =20 argv0=3D$0 aanto=3D86400 #one day +aanport=3D0 fn usage { - echo 'usage:' $argv0 '[-u user] [-k keypattern] [-p] [-t = timeout] host remotescript localcommand arg ...' >[1=3D2] + echo 'usage:' $argv0 '[-u user] [-k keypattern] [-p] [-t = timeout] [-P aanport] host remotescript localcommand arg ...' >[1=3D2] exit 'usage' } =20 @@ -27,6 +28,7 @@ case -k; keyspec=3D($keyspec $2) case -u; keyspec=3D($keyspec `{user=3D$2 pvar user}) case -t; aanto=3D$2 + case -P; aanport=3D$2 case *; usage } shift @@ -50,11 +52,12 @@ fn aanserver { ~ $#netdir 1 || netdir=3D/net/tcp/clone netdir=3D`{basename -d $netdir} || exit - <>$netdir/clone { - netdir=3D$netdir/`{read} || exit + <>[4]$netdir/clone { + netdir=3D$netdir/`{read <[0=3D4]} || exit >[3] $netdir/ctl { - echo -n 'announce *!0' >[1=3D3] + echo -n 'announce *!'$aanport >[1=3D3] = || exit echo `{cat $netdir/local} || exit + ~ `{read} OK || exit bind '#|' /mnt/aan || exit exec aan -m $aanto $netdir = <>/mnt/aan/data1 >[1=3D0] >[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=3D`{read} && ! ~ $#n 0 && read -c = $n} >[2=3D1] } exec tlssrv -A /bin/rc -c server @@ -72,9 +75,10 @@ } fn aanclient { host=3D`{echo $host | sed = 's/(.*)!([^!]+)$/\1/'}^!^`{read | sed 's/(.*)!([^!]+)$/\2/'} || exit + echo OK || exit tlsclient -a -o <>{rfork s; aan -m $aanto -c $host = >[1=3D0]} /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 } =20 --- 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/11 >[2]/mnt/term/fd/12 { - ~ $#dir 0 || cd $"dir || echo 'can''t change directory: = '^$"dir >[1=3D2] + ~ $#dir 0 || cd $"dir >/dev/null >[2=3D1] switch($#cmd){ case 0; cmd=3D(rc -li) case 1; cmd=3D(rc -lc $cmd) --- a/rc/bin/rimport +++ b/rc/bin/rimport @@ -3,7 +3,7 @@ =20 argv0=3D$0 fn usage { - echo 'usage:' $argv0 '[-abcCnq] [-s name] [-u user] [-k = keypattern] [-p] [-t timeout] host tree [mountpoint]' >[1=3D2] + echo 'usage:' $argv0 '[-abcCnq] [-s name] [-u user] [-k = keypattern] [-p] [-t timeout] [-P aanport] host tree [mountpoint]' = >[1=3D2] exit 'usage' } =20 @@ -29,7 +29,7 @@ case * ~ $#* 1 && usage switch($1){ - case -[ukt]; connect=3D($connect $1 $2) + case -[uktP]; connect=3D($connect $1 $2) case -s; sname=3D`{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 @@ } =20 fn connecttcp{ - while(! ~ $#fs 0 && ! srv -q tcp!$fs(1)^!564 boot) + while(! ~ $#fs 0 && ! srv -q $srvopt tcp!$fs(1)^!564 boot) fs=3D$fs(2-); fs=3D$fs(1) } =20 fn connecttls{ - while(! ~ $#fs 0 && ! srvtls -q tcp!$fs(1)^!17020 boot) + while(! ~ $#fs 0 && ! srvtls -q $srvopt tcp!$fs(1)^!17020 boot) fs=3D$fs(2-); fs=3D$fs(1) } =20 +fn connecttlsaan{ + while(! ~ $#fs 0 && ! srvtlsaan -q $srvopt tcp!$fs(1)^!17019 = boot) + fs=3D$fs(2-); + fs=3D$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=3D$fs(2-); fs=3D$fs(1) } @@ -84,6 +90,7 @@ =20 mtcp=3D(confignet connecttcp) mtls=3D(confignet connecttls) +mtlsaan=3D(confignet connecttlsaan) mil=3D(confignet connectil) =20 -mt=3D(mtcp mtls mil $mt) +mt=3D(mtcp mtls mtlsaan mil $mt) --- a/sys/src/cmd/aan.c +++ b/sys/src/cmd/aan.c @@ -357,10 +357,6 @@ =20 err[0] =3D '\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); }