9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] a small error in /rc/bin/cpurc
@ 2007-11-07  3:02 Joshua Wood
  2007-11-07  3:17 ` erik quanstrom
  0 siblings, 1 reply; 14+ messages in thread
From: Joshua Wood @ 2007-11-07  3:02 UTC (permalink / raw)
  To: 9fans

> until recently I put ip=192.178.123.123 in plan9.ini and then wrote a
> bit of script in termrc.local to check for its existence and use it

Did you figure out that you could just set the IP with bootargs  
instead and skip the bit of script in termrc.local? Because that only  
recently dawned on me, when I read a reply on this thread...

(I still recommended that the original poster call ipconfig in  
cpurc.local or /cfg/*/cpurc, because he specifically wanted to get  
his ip from his existing dhcp setup.)

>
> There are loads of ways to actually get your IP address into the  
> system,
> its like frigging Perl and tmtowtdi!
>

Somewhat true, though I'm not ready to say I've found anything in  
plan 9 that's "like Perl" ;-)
Once you have auth and dhcp going, all the rest of the systems on the  
network get configured by dhcp in boot (if diskless) or in  
$service^rc (if diskful). And that leads me to the question that I  
should have asked Erik a couple days ago:

> for the standalone machines i have, i typically use the bootargs to  
> set up networking
> before the root fs is mounted.this is the plan9.ini from the one  
> machine we have at
> coraid that boots stand-alone, the auth server:
>
> 	bootfile=sdD0!9fat!9myri
> 	bootargs=il -d -g 205.185.197.254 ether /net/ether0 205.185.197.99  
> 255.255.255.0
> 	fs=205.185.197.100
> 	auth=205.185.197.99
> 	console=0

We've typically configured IP for our one standalone auth server  
from /cfg/$sysname/cpurc; I want to know if I've understood why  
you're doing it with plan9.ini bootargs instead: Is the advantage  
that you get the variables set in /net/ndb (fs, auth, etc) that I  
don't get when I call ip/ipconfig to set up a manual ip address from  
an rc script later in the boot?

--
Josh


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
  2007-11-07  3:02 [9fans] a small error in /rc/bin/cpurc Joshua Wood
@ 2007-11-07  3:17 ` erik quanstrom
  0 siblings, 0 replies; 14+ messages in thread
From: erik quanstrom @ 2007-11-07  3:17 UTC (permalink / raw)
  To: 9fans

> We've typically configured IP for our one standalone auth server  
> from /cfg/$sysname/cpurc; I want to know if I've understood why  
> you're doing it with plan9.ini bootargs instead: Is the advantage  
> that you get the variables set in /net/ndb (fs, auth, etc) that I  
> don't get when I call ip/ipconfig to set up a manual ip address from  
> an rc script later in the boot?

we don't have any cpu servers that host their own filesystem.  we use
ken's fileserver.  so when the auth server boots, it must get its network
configuration from plan9.ini.  there are no files at this point in the process.
and in order to get files, we need a network.

the auth server serves dhcp/tftp.  so everybody else pxe boots.

i've considered building a very small fossil on a flash drive for the auth
server so it can be booted independenly of the fileserver and to have
a place to keep authentication information outside of the fs.  
such a change has not yet been compelling.

- erik


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
@ 2007-11-07  5:51 Joshua Wood
  0 siblings, 0 replies; 14+ messages in thread
From: Joshua Wood @ 2007-11-07  5:51 UTC (permalink / raw)
  To: 9fans

> we don't have any cpu servers that host their own filesystem.  we use
> ken's fileserver.  so when the auth server boots, it must get its  
> network
> configuration from plan9.ini.  there are no files at this point in  
> the process.
> and in order to get files, we need a network.

Enlightening, and clears up my confusion about your use of the term  
"stand-alone" in reference to your auth server earlier. I had  
mistaken it to mean "local root."

Thanks for your answers -- I don't know if the original poster got a  
solution he wanted, but you suggested a new angle of attack to me.

--
Josh




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
  2007-11-05 12:59 Joshua Wood
  2007-11-05 13:27 ` Antonin Vecera
@ 2007-11-06 21:57 ` maht-9fans
  1 sibling, 0 replies; 14+ messages in thread
From: maht-9fans @ 2007-11-06 21:57 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

until recently I put ip=192.178.123.123 in plan9.ini and then wrote a 
bit of script in termrc.local to check for its existence and use it

There are loads of ways to actually get your IP address into the system, 
its like frigging Perl and tmtowtdi!


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
@ 2007-11-05 14:51 Joshua Wood
  0 siblings, 0 replies; 14+ messages in thread
From: Joshua Wood @ 2007-11-05 14:51 UTC (permalink / raw)
  To: 9fans

>
> But... unfortunately I don't have spare machine to run Plan9 native.
> I must run Plan9 in VMware player.

Well understood. We use a virtual machine product ourselves for  
terminals and for testing.

While you might not utilize all the possibilities of network  
management with Plan 9 because you're on vmware, I think my first  
sentence still applies: It appears you've found a good reason to make  
a little, one-time edit to your ndb file. If you're running as a cpu  
server for any good reason, you're going to want to set at least a  
few values in ndb to help the system work smoothly. Things like the  
value of $cpu, authserver, and fileserver for terminals, for starters.

If you're running as a cpu server in a vm just to log in at the  
console, not run any terminals or even drawterms, and you like  
termrc, I'm not sure I understand why you're even running a cpu  
kernel for your current purposes.

Lastly, I may be missing something, but it seems like if you make  
your call to ip/ipconfig to get your DHCP-provided ip address in  
either of /bin/cpurc.local or /cfg/$sysname/cpurc, you would achieve  
your desired behavior when the /bin/cpurc invocation of ndb/dns -r  
happens.

--
Josh





^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
  2007-11-05 10:18 ` arisawa
@ 2007-11-05 14:02   ` Antonin Vecera
  0 siblings, 0 replies; 14+ messages in thread
From: Antonin Vecera @ 2007-11-05 14:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 11/5/07, arisawa@ar.aichi-u.ac.jp <arisawa@ar.aichi-u.ac.jp> wrote:
> Hello,
>
> I downloaded CD-ROM image today, and found the order in /bin/termrc is
> ip/ipconfig
> ndb/dns -r

termrc is OK.
I don't like cpurc .

Antonin


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
  2007-11-05 12:59 Joshua Wood
@ 2007-11-05 13:27 ` Antonin Vecera
  2007-11-06 21:57 ` maht-9fans
  1 sibling, 0 replies; 14+ messages in thread
From: Antonin Vecera @ 2007-11-05 13:27 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 11/5/07, Joshua Wood <josh@utopian.net> wrote:
> > > why the resistance to putting your machine into /lib/ndb/local?
> >
> > I want to have (if possible) only 1 place where I define IP address
> > assignment.
> > (+ dns, router, and in case of Plan9 fs+auth server)
> > So if i need to change something, I don't need to meditate where else
> > should I go.
> > But maybe in future I will find some reason to make my /lib/ndb/local
> > more accurate.
>
> Maybe you have found a reason. If you want to have only one place to
> define your ip address assignments, DNS, etc, etc, a look at the man
> pages for dns(8), dhcpd(8) and ndb(6) could bring you much happiness.
> You can use plan 9 to provide those infrastructure services for your
> network.
>
> The centralization of network config through ndb was the second of
> two qualities that got us investigating plan9 at my company, and I
> haven't seen another system that approaches the completeness and
> elegance of this approach. DNS without manually making PTR records
> and incrementing serial numbers? PRICELESS.
>
> --
> Josh
>

100% agree.
But... unfortunately I don't have spare machine to run Plan9 native.
I must run Plan9 in VMware player.

Antonin


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
@ 2007-11-05 12:59 Joshua Wood
  2007-11-05 13:27 ` Antonin Vecera
  2007-11-06 21:57 ` maht-9fans
  0 siblings, 2 replies; 14+ messages in thread
From: Joshua Wood @ 2007-11-05 12:59 UTC (permalink / raw)
  To: 9fans

> > why the resistance to putting your machine into /lib/ndb/local?
>
> I want to have (if possible) only 1 place where I define IP address  
> assignment.
> (+ dns, router, and in case of Plan9 fs+auth server)
> So if i need to change something, I don't need to meditate where else
> should I go.
> But maybe in future I will find some reason to make my /lib/ndb/local
> more accurate.

Maybe you have found a reason. If you want to have only one place to  
define your ip address assignments, DNS, etc, etc, a look at the man  
pages for dns(8), dhcpd(8) and ndb(6) could bring you much happiness.  
You can use plan 9 to provide those infrastructure services for your  
network.

The centralization of network config through ndb was the second of  
two qualities that got us investigating plan9 at my company, and I  
haven't seen another system that approaches the completeness and  
elegance of this approach. DNS without manually making PTR records  
and incrementing serial numbers? PRICELESS.

--
Josh


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
  2007-11-03 17:12 Antonin Vecera
  2007-11-03 21:30 ` erik quanstrom
@ 2007-11-05 10:18 ` arisawa
  2007-11-05 14:02   ` Antonin Vecera
  1 sibling, 1 reply; 14+ messages in thread
From: arisawa @ 2007-11-05 10:18 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,

I downloaded CD-ROM image today, and found the order in /bin/termrc is
ip/ipconfig
ndb/dns -r


On 2007/11/04, at 2:12, Antonin Vecera wrote:

> Hi all,
>
> there is a bad order in initialization of network in /rc/bin/cpurc:
>
> ndb/dns -r
> ip/ipconfig
>
> When I boot with these settings I get message:
>
>          ndb/dns: can't read my ip address
>
> I suggest to swap these commands.
>
>
> Antonin


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
  2007-11-04 16:48     ` erik quanstrom
@ 2007-11-05  7:31       ` Antonin Vecera
  0 siblings, 0 replies; 14+ messages in thread
From: Antonin Vecera @ 2007-11-05  7:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> if you either (a) allowed dhcp to configure your ip address, even
> if it's a static one, or added your machine/ip address to /lib/ndb/local,
> the standard cpurc would work for you.

I don't agree. If I used dhcp and my machine not added to
/lib/ndb/local, I got an error message and I had to run "ndb/dns -r"
from command line.

> why the resistance to putting your machine into /lib/ndb/local?

I want to have (if possible) only 1 place where I define IP address assignment.
(+ dns, router, and in case of Plan9 fs+auth server)
So if i need to change something, I don't need to meditate where else
should I go.
But maybe in future I will find some reason to make my /lib/ndb/local
more accurate.
I just look around and I love playing with Plan9.

Antonin


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
  2007-11-04 11:18   ` Antonin Vecera
@ 2007-11-04 16:48     ` erik quanstrom
  2007-11-05  7:31       ` Antonin Vecera
  0 siblings, 1 reply; 14+ messages in thread
From: erik quanstrom @ 2007-11-04 16:48 UTC (permalink / raw)
  To: 9fans

> I use in my home network local DNS+DHCP server and my fs/auth/cpu
> Plan9 server gets statically configured IP address. So my network
> isn't defined in my Plan9 ndb database.
> First I configure my ethernet device (ip/ipconfig) and then dns
> service (ndb/dns -r).
> 
> I am the beginner with Plan9 and maybe i am wrong, but I think that if
> I first do ip/ipconfig and then ndb/dns -r , it will work for me and
> even for you. If you change the order, it will work only for you.

if you either (a) allowed dhcp to configure your ip address, even
if it's a static one, or added your machine/ip address to /lib/ndb/local,
the standard cpurc would work for you.

why the resistance to putting your machine into /lib/ndb/local?

- erik


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
  2007-11-03 21:30 ` erik quanstrom
@ 2007-11-04 11:18   ` Antonin Vecera
  2007-11-04 16:48     ` erik quanstrom
  0 siblings, 1 reply; 14+ messages in thread
From: Antonin Vecera @ 2007-11-04 11:18 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I use in my home network local DNS+DHCP server and my fs/auth/cpu
Plan9 server gets statically configured IP address. So my network
isn't defined in my Plan9 ndb database.
First I configure my ethernet device (ip/ipconfig) and then dns
service (ndb/dns -r).

I am the beginner with Plan9 and maybe i am wrong, but I think that if
I first do ip/ipconfig and then ndb/dns -r , it will work for me and
even for you. If you change the order, it will work only for you.


Antonin


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] a small error in /rc/bin/cpurc
  2007-11-03 17:12 Antonin Vecera
@ 2007-11-03 21:30 ` erik quanstrom
  2007-11-04 11:18   ` Antonin Vecera
  2007-11-05 10:18 ` arisawa
  1 sibling, 1 reply; 14+ messages in thread
From: erik quanstrom @ 2007-11-03 21:30 UTC (permalink / raw)
  To: 9fans

> there is a bad order in initialization of network in /rc/bin/cpurc:
> 
> ndb/dns -r
> ip/ipconfig
> 
> When I boot with these settings I get message:
> 
>          ndb/dns: can't read my ip address
> 
> I suggest to swap these commands.

on plan 9, ndb, not dns is generally required to resolve ip addresses.
to read cpurc, one needs a connection to the fileserver, so at this point
we can resolve files.  if the fs is remote, this means that networking is
already configured.  either way, the local machine's ip address should be
in /lib/ndb/local for dns to find.  each plan 9 host should have an /lib/ndb/local
entry along the lines of

	sys=kremvax ip=9.18.36.72		# required.
		ether=000102030405	# optional, for plan 9 dhcp.
		dom=kremvax.ibm.com	# optional, for dns.

for the standalone machines i have, i typically use the bootargs to set up networking
before the root fs is mounted.this is the plan9.ini from the one machine we have at
coraid that boots stand-alone, the auth server:

	bootfile=sdD0!9fat!9myri
	bootargs=il -d -g 205.185.197.254 ether /net/ether0 205.185.197.99 255.255.255.0
	fs=205.185.197.100
	auth=205.185.197.99
	console=0

by the way, since i can't often remember ether addresses, i wrote
this script to find the pxe .ini file for the named machines:


	#!/bin/rc
	rfork e

	for(i)
		for(ether in `{ndb/query -m sys $1 ether}){
			pxe = /cfg/pxe/$ether
			if(test -e $pxe)
				echo $pxe
		}

- erik


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [9fans] a small error in /rc/bin/cpurc
@ 2007-11-03 17:12 Antonin Vecera
  2007-11-03 21:30 ` erik quanstrom
  2007-11-05 10:18 ` arisawa
  0 siblings, 2 replies; 14+ messages in thread
From: Antonin Vecera @ 2007-11-03 17:12 UTC (permalink / raw)
  To: 9fans

Hi all,

there is a bad order in initialization of network in /rc/bin/cpurc:

ndb/dns -r
ip/ipconfig

When I boot with these settings I get message:

         ndb/dns: can't read my ip address

I suggest to swap these commands.


Antonin


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-11-07  5:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-07  3:02 [9fans] a small error in /rc/bin/cpurc Joshua Wood
2007-11-07  3:17 ` erik quanstrom
  -- strict thread matches above, loose matches on Subject: below --
2007-11-07  5:51 Joshua Wood
2007-11-05 14:51 Joshua Wood
2007-11-05 12:59 Joshua Wood
2007-11-05 13:27 ` Antonin Vecera
2007-11-06 21:57 ` maht-9fans
2007-11-03 17:12 Antonin Vecera
2007-11-03 21:30 ` erik quanstrom
2007-11-04 11:18   ` Antonin Vecera
2007-11-04 16:48     ` erik quanstrom
2007-11-05  7:31       ` Antonin Vecera
2007-11-05 10:18 ` arisawa
2007-11-05 14:02   ` Antonin Vecera

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).