From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 15 Oct 2013 15:15:17 +0200 From: Steffen "Daode" Nurpmeso To: erik quanstrom Message-ID: <20131015141517.bphExS/C92FhFNd7gqDyCj4w@dietcurd.local> References: <250d3e7e5500a6e7d72c8ab3d49f9641@coraid.com> <20131015133242.BzZtmIHXbY5g5ZxUYrTW3X/A@dietcurd.local> In-Reply-To: <20131015133242.BzZtmIHXbY5g5ZxUYrTW3X/A@dietcurd.local> User-Agent: s-nail v14.4.4-38-gb5a1aeb MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_01381842917=-cXR36PyD+weunGqJCL25Jf+BcOuT/m=_" Cc: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] [sources] applied patch: /n/atom/patch/applied/termrcnodhcp Topicbox-Message-UUID: 860fa6ce-ead8-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --=_01381842917=-cXR36PyD+weunGqJCL25Jf+BcOuT/m=_ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline hmm, i'm braindead. And that made it especially hard to deal with ipconfig(8): by default, ipconfig exits after trying DHCP for 15 seconds with no answer --steffen --=_01381842917=-cXR36PyD+weunGqJCL25Jf+BcOuT/m=_ Content-Type: message/rfc822 Content-Disposition: inline Content-Description: Original message content Date: Tue, 15 Oct 2013 14:32:42 +0200 From: Steffen "Daode" Nurpmeso To: erik quanstrom Subject: Re: [sources] applied patch: /n/atom/patch/applied/termrcnodhcp Cc: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20131015133242.BzZtmIHXbY5g5ZxUYrTW3X/A@dietcurd.local> References: <250d3e7e5500a6e7d72c8ab3d49f9641@coraid.com> In-Reply-To: <250d3e7e5500a6e7d72c8ab3d49f9641@coraid.com> User-Agent: s-nail v14.4.4-38-gb5a1aeb MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_01381840362=-G+7vS0VjyOkpKVwGvmHQLxt9sEQZj6=_" Status: RO This is a multi-part message in MIME format. --=_01381840362=-G+7vS0VjyOkpKVwGvmHQLxt9sEQZj6=_ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, erik quanstrom wrote: |email | quanstro@quanstro.net |readme | don't dhcp by default. it looks like a hang. [.] |+ #if(! test -e /net/ipifc/0/ctl || ~ 127.0.0.1 `{cat /net/ipifc/0/local}= ) |+ # ip/ipconfig >/dev/null >[2=3D1] [.] after looking into the ipconfig source and placing some fprint() the actual "hang" is caused by a faulty length of the sleep. If i add --- a/sys/src/cmd/ip/ipconfig/main.c +++ b/sys/src/cmd/ip/ipconfig/main.c @@ -469,6 +469,12 @@ main(int argc, char **argv) int retry, action; Ctl *cp; =20 + for (retry =3D 0; retry < 10; ++retry) { + long t =3D time(nil); + fprint(2, "retry %d, time %ld\n", retry, t); + sleep(1000); + } + init(); retry =3D 0; ARGBEGIN { then each tick sleeps ~1 second (sometimes a tick needed 3 in the tests i've done). But if i add --- a/sys/src/cmd/ip/ipconfig/main.c +++ b/sys/src/cmd/ip/ipconfig/main.c @@ -621,10 +621,13 @@ doadd(int retry) if(dodhcp){ mkclientid(); for(tries =3D 0; tries < 30; tries++){ + long t; dhcpquery(!noconfig, Sselecting); if(conf.state =3D=3D Sbound) break; sleep(1000); + t =3D time(nil); + fprint(2, "retry %d, time %ld\n", tries, t); } } then that sleep takes reproducably 12 seconds. Without having any ideas what this could be about (VirtualBox?), i nonetheless wonder wether something like this would be imaginable, since a time difference is used later on in the code, too: --- a/sys/src/cmd/ip/ipconfig/main.c +++ b/sys/src/cmd/ip/ipconfig/main.c @@ -619,12 +619,15 @@ doadd(int retry) =20 /* run dhcp if we need something */ if(dodhcp){ + long start =3D time(nil); mkclientid(); for(tries =3D 0; tries < 30; tries++){ dhcpquery(!noconfig, Sselecting); if(conf.state =3D=3D Sbound) break; sleep(1000); + if (tries > 1 && time(nil) - start > 30) + break; } } Apologies for the patch format (it's all half-baked here). --steffen --=_01381840362=-G+7vS0VjyOkpKVwGvmHQLxt9sEQZj6=_ Content-Type: message/rfc822 Content-Disposition: inline Content-Description: Original message content Delivered-To: sdaoden@gmail.com Received: by 10.42.112.10 with SMTP id w10csp159206icp; Sun, 13 Oct 2013 10:18:31 -0700 (PDT) X-Received: by 10.236.38.162 with SMTP id a22mr23529150yhb.30.1381684710511; Sun, 13 Oct 2013 10:18:30 -0700 (PDT) Return-Path: Received: from ladd.quanstro.net (ladd.quanstro.net. [69.55.170.73]) by mx.google.com with ESMTP id o48si23388858yhb.372.1969.12.31.16.00.00; Sun, 13 Oct 2013 10:18:29 -0700 (PDT) Received-SPF: pass (google.com: domain of sources-bounces@quanstro.net designates 69.55.170.73 as permitted sender) client-ip=69.55.170.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sources-bounces@quanstro.net designates 69.55.170.73 as permitted sender) smtp.mail=sources-bounces@quanstro.net Received: from coraid.com ([208.71.232.133]) by ladd; Sun Oct 13 13:18:04 EDT 2013 From: erik quanstrom Date: Sun, 13 Oct 2013 13:18:00 -0400 To: sources@9atom.org Message-ID: <250d3e7e5500a6e7d72c8ab3d49f9641@coraid.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Subject: [sources] applied patch: /n/atom/patch/applied/termrcnodhcp Reply-To: sources@9atom.org Precedence: bulk Status: RO Content-Transfer-Encoding: quoted-printable email quanstro@quanstro.net readme don't dhcp by default. it looks like a hang. set sysname, even if ndb not cooperative use diskparts instead of inline code removed =09 files /rc/bin/termrc termrc /rc/bin/termrc termrc termrc.orig:10,18 - termrc:10,22 mntgen -s slashn && chmod 666 /srv/slashn ndb/cs -f $ndbfile sysname=3D`{cat /dev/sysname} + if(~ $#sysname 0){ + sysname =3D gnot + echo -n $sysname >/dev/sysname + } =20 - if(! test -e /net/ipifc/0/ctl || ~ 127.0.0.1 `{cat /net/ipifc/0/local}) - ip/ipconfig >/dev/null >[2=3D1] + #if(! test -e /net/ipifc/0/ctl || ~ 127.0.0.1 `{cat /net/ipifc/0/local}= ) + # ip/ipconfig >/dev/null >[2=3D1] if(test -e /net/ipifc/0/ctl) ndb/dns -rf $ndbfile for(i in /net/ether?) termrc.orig:30,41 - termrc:34,44 =20 for(i in A w f t m u v L '$' =CE=99 =CE=A3 =CE=BA =C3=A6 =C2=A9) /bin/bind -a '#'^$i /dev >/dev/null >[2=3D1] - for(disk in /dev/sd??) { - if(test -f $disk/data && test -f $disk/ctl) - disk/fdisk -p $disk/data >$disk/ctl >[2]/dev/null - for(part in $disk/plan9*) - if(test -f $part) - disk/prep -p $part >$disk/ctl >[2]/dev/null + diskparts + sysname=3D`{cat /dev/sysname} + if (~ $#sysname 0 || ~ $sysname '') { + sysname =3D gnot + echo -n $sysname >/dev/sysname } =20 # hacks ------ merge...backup...copy... cpfile termrc /n/dist/rc/bin/termrc # remove these files if you want. I will not remove them for you # (apatch/undo will not restore them) done --=_01381840362=-G+7vS0VjyOkpKVwGvmHQLxt9sEQZj6=_-- --=_01381842917=-cXR36PyD+weunGqJCL25Jf+BcOuT/m=_--