9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] new termrc
@ 2007-04-26 23:15 geoff
  2007-04-30  8:29 ` [9fans] " Alex Brainman
  0 siblings, 1 reply; 13+ messages in thread
From: geoff @ 2007-04-26 23:15 UTC (permalink / raw)
  To: 9fans

I've just pushed out a new (and I hope stable) /rc/bin/termrc
and /cfg/example/termrc.  Machine-specific configuration should
go into /cfg/$sysname/termrc.  If you don't use DHCP (i.e., you
statically configure terminal IP addresses), this affects you.
You'll probably want to look at the diffs in any case.


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

* [9fans] Re: new termrc
  2007-04-26 23:15 [9fans] new termrc geoff
@ 2007-04-30  8:29 ` Alex Brainman
  2007-04-30 15:09   ` Russ Cox
  2007-05-02  8:36   ` Alex Brainman
  0 siblings, 2 replies; 13+ messages in thread
From: Alex Brainman @ 2007-04-30  8:29 UTC (permalink / raw)
  To: 9fans

On Apr 27, 9:16 am, g...@plan9.bell-labs.com wrote:
> I've just pushed out a new (and I hope stable) /rc/bin/termrc
> and /cfg/example/termrc.  Machine-specific configuration should
> go into /cfg/$sysname/termrc.  If you don't use DHCP (i.e., you
> statically configure terminal IP addresses), this affects you.
> You'll probably want to look at the diffs in any case.

I need an advice. I have a standalone plan9 computer, and if I use
the /rc/bin/termrc, then my $sysname is blank. It's, obviously,
because I use DHCP to set my ip address and other parameters, and I
use those settings as part of my network database. But at the time
when /rc/bin/termrc sets $sysname, network is not started yet and all
those parameters aren't available yet.

My /lib/ndb/local includes line:

	file=/lib/ndb/common

and I use DHCP to get my address and /lib/ndb/common contains:

ip=192.168.21.14 ipmask=255.255.255.128 ipgw=192.168.21.1
	sys=plan9term
	dom=plan9term.linux.sge.local sge.local
	dns=192.168.21.1

If I move

sysname=`{cat /dev/sysname}

line down after section where network is set, $sysname gets correct
value all right.

What am I doing wrong? Or is my setup "non-standard" enough and
I'can't use this general /rc/bin/termrc?

Thank you.


Alex


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

* Re: [9fans] Re: new termrc
  2007-04-30  8:29 ` [9fans] " Alex Brainman
@ 2007-04-30 15:09   ` Russ Cox
  2007-04-30 15:23     ` Lucio De Re
  2007-05-02  8:36   ` Alex Brainman
  1 sibling, 1 reply; 13+ messages in thread
From: Russ Cox @ 2007-04-30 15:09 UTC (permalink / raw)
  To: 9fans

> I need an advice. I have a standalone plan9 computer, and if I use
> the /rc/bin/termrc, then my $sysname is blank. It's, obviously,
> because I use DHCP to set my ip address and other parameters, and I
> use those settings as part of my network database. But at the time
> when /rc/bin/termrc sets $sysname, network is not started yet and all
> those parameters aren't available yet.

ndb/cs sets $sysname when it starts up by
looking for an entry in the ndb with the 
right ethernet address (cat /net/ether0/addr).
if you add ether=010203040506 (with your
ethernet address) to the entry for your system
then $sysname should get set.

russ



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

* Re: [9fans] Re: new termrc
  2007-04-30 15:09   ` Russ Cox
@ 2007-04-30 15:23     ` Lucio De Re
  2007-04-30 15:32       ` erik quanstrom
                         ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Lucio De Re @ 2007-04-30 15:23 UTC (permalink / raw)
  To: 9fans

> if you add ether=010203040506 (with your
> ethernet address) to the entry for your system
> then $sysname should get set.

But that is ugly, as you now need to track the ethernet address in
/lib/ndb/local and possibly in the DHCP configuration, when all the
pertinent details can be obtained from the DHCP server.  Are there any
philosophical reasons that the DHCP data, retrieved using ip/ipconfig,
say, cannot at least supplement whatever may have been already set up
by termrc (or cpurc)?  If there isn't I'll gladly look into it, DHCP
isn't entirely alien to me.

++L



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

* Re: [9fans] Re: new termrc
  2007-04-30 15:23     ` Lucio De Re
@ 2007-04-30 15:32       ` erik quanstrom
  2007-04-30 15:41         ` Lucio De Re
  2007-04-30 15:42       ` Russ Cox
                         ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: erik quanstrom @ 2007-04-30 15:32 UTC (permalink / raw)
  To: lucio, 9fans

if you're using a plan 9 dhcp server, you need the ethernet
entry anyway to figure out whom to give what configuration.

i think this would only be an issue with a non-plan 9 dhcp server.

- erik


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

* Re: [9fans] Re: new termrc
  2007-04-30 15:32       ` erik quanstrom
@ 2007-04-30 15:41         ` Lucio De Re
  0 siblings, 0 replies; 13+ messages in thread
From: Lucio De Re @ 2007-04-30 15:41 UTC (permalink / raw)
  To: 9fans

> i think this would only be an issue with a non-plan 9 dhcp server.

A common enough occurrence, I imagine.

++L



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

* Re: [9fans] Re: new termrc
  2007-04-30 15:23     ` Lucio De Re
  2007-04-30 15:32       ` erik quanstrom
@ 2007-04-30 15:42       ` Russ Cox
  2007-04-30 19:49       ` Steve Simon
                         ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Russ Cox @ 2007-04-30 15:42 UTC (permalink / raw)
  To: lucio, 9fans

> But that is ugly, as you now need to track the ethernet address in
> /lib/ndb/local and possibly in the DHCP configuration, when all the
> pertinent details can be obtained from the DHCP server.  Are there any
> philosophical reasons that the DHCP data, retrieved using ip/ipconfig,
> say, cannot at least supplement whatever may have been already set up
> by termrc (or cpurc)?  If there isn't I'll gladly look into it, DHCP
> isn't entirely alien to me.

The pertinent details cannot be obtained
from a non-Plan 9 DHCP server.
If you are using a Plan 9 DHCP server
then you are correct -- all the details
do get used from DHCP and no extra work
is necessary.  But it sounds like his DHCP
server is a random NAT box.

All you need to put in /lib/ndb/local in that
case is 

	sys=yourname ether=010203040506

and the DHCP info will be used (via /net/ndb,
which ipconfig fills in) for the rest.

Truth be told, when I set up a standalone
system I don't even bother doing this.  I just do

	sysname=foo
	echo -n foo >/dev/sysname

in cpurc before starting cs.  It doesn't really
matter one way or the other.

Russ



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

* Re: [9fans] Re: new termrc
  2007-04-30 15:23     ` Lucio De Re
  2007-04-30 15:32       ` erik quanstrom
  2007-04-30 15:42       ` Russ Cox
@ 2007-04-30 19:49       ` Steve Simon
  2007-04-30 20:00         ` Devon H. O'Dell
  2007-05-01  9:39         ` matt
  2007-05-02  8:36       ` Alex Brainman
  2007-05-02  8:36       ` Alex Brainman
  4 siblings, 2 replies; 13+ messages in thread
From: Steve Simon @ 2007-04-30 19:49 UTC (permalink / raw)
  To: lucio, 9fans

> if you add ether=010203040506 (with your
> ethernet address) to the entry for your system
> then $sysname should get set.

Beware, the ether= field must have the ethernet address
in lower case, this is because all fields are case sensitive
when they are matched by libndb and the accress printed
by /dev/ether0/addr is in lower case.

-Steve


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

* Re: [9fans] Re: new termrc
  2007-04-30 19:49       ` Steve Simon
@ 2007-04-30 20:00         ` Devon H. O'Dell
  2007-05-01  9:39         ` matt
  1 sibling, 0 replies; 13+ messages in thread
From: Devon H. O'Dell @ 2007-04-30 20:00 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

2007/4/30, Steve Simon <steve@quintile.net>:
> > if you add ether=010203040506 (with your
> > ethernet address) to the entry for your system
> > then $sysname should get set.
>
> Beware, the ether= field must have the ethernet address
> in lower case, this is because all fields are case sensitive
> when they are matched by libndb and the accress printed
> by /dev/ether0/addr is in lower case.

This is true. I remember getting bitten by this and Boyd (may his soul
rest in peace) ranting about how ridiculous it was when we were
setting things up on a Mini-ITX board.

> -Steve

--dho


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

* Re: [9fans] Re: new termrc
  2007-04-30 19:49       ` Steve Simon
  2007-04-30 20:00         ` Devon H. O'Dell
@ 2007-05-01  9:39         ` matt
  1 sibling, 0 replies; 13+ messages in thread
From: matt @ 2007-05-01  9:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

you could always do

sysname=foo

in plan9.ini

you can also set other environment variables in there to use in termrc, 
termrc.local and cpurc

I have a plan9.ini menu that sets ip=10.0.0.9 or 192.168.9.9 or DHCP 
which I then use in termrc.local to choose how to use ip/ipconfig





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

* [9fans] Re: new termrc
  2007-04-30  8:29 ` [9fans] " Alex Brainman
  2007-04-30 15:09   ` Russ Cox
@ 2007-05-02  8:36   ` Alex Brainman
  1 sibling, 0 replies; 13+ messages in thread
From: Alex Brainman @ 2007-05-02  8:36 UTC (permalink / raw)
  To: 9fans

On May 1, 1:10 am, r...@swtch.com (Russ Cox) wrote:

> if you add ether=010203040506 (with your
> ethernet address) to the entry for your system
> then $sysname should get set.

I have and it does, thank you russ. I just thought, the information is
already inside my DHCP server (non-plan9) and should be used by my
terminal. But that's good enough anyway.


Alex


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

* [9fans] Re: new termrc
  2007-04-30 15:23     ` Lucio De Re
                         ` (2 preceding siblings ...)
  2007-04-30 19:49       ` Steve Simon
@ 2007-05-02  8:36       ` Alex Brainman
  2007-05-02  8:36       ` Alex Brainman
  4 siblings, 0 replies; 13+ messages in thread
From: Alex Brainman @ 2007-05-02  8:36 UTC (permalink / raw)
  To: 9fans

On May 1, 1:37 am, quans...@coraid.com (erik quanstrom) wrote:
> i think this would only be an issue with a non-plan 9 dhcp server.

my DHCP server is http://www.isc.org/products/DHCP
 running on linux.

Alex


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

* [9fans] Re: new termrc
  2007-04-30 15:23     ` Lucio De Re
                         ` (3 preceding siblings ...)
  2007-05-02  8:36       ` Alex Brainman
@ 2007-05-02  8:36       ` Alex Brainman
  4 siblings, 0 replies; 13+ messages in thread
From: Alex Brainman @ 2007-05-02  8:36 UTC (permalink / raw)
  To: 9fans

On May 1, 1:43 am, r...@swtch.com (Russ Cox) wrote:
> ...  But it sounds like his DHCP
> server is a random NAT box.
>

DHCP server is http://www.isc.org/products/DHCP running on linux.


Alex


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

end of thread, other threads:[~2007-05-02  8:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-26 23:15 [9fans] new termrc geoff
2007-04-30  8:29 ` [9fans] " Alex Brainman
2007-04-30 15:09   ` Russ Cox
2007-04-30 15:23     ` Lucio De Re
2007-04-30 15:32       ` erik quanstrom
2007-04-30 15:41         ` Lucio De Re
2007-04-30 15:42       ` Russ Cox
2007-04-30 19:49       ` Steve Simon
2007-04-30 20:00         ` Devon H. O'Dell
2007-05-01  9:39         ` matt
2007-05-02  8:36       ` Alex Brainman
2007-05-02  8:36       ` Alex Brainman
2007-05-02  8:36   ` Alex Brainman

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