Subject: Re: uname question
To: None <email@example.com>
From: Stephen Anspach <firstname.lastname@example.org>
Date: 12/08/1994 13:44:46
> > When I invoke "uname -n", I simply get my nodename (xor), but not the FQDN
> > (xor.lax.primenet.com). I believe this is incorrect behavior, yes?
> > Where is this taking it's info from? The current kernel in memory, or
> > /etc/myname? Should I just "fix" the kernel info and recompile, or am I
> > configured wrong?
> That string is generated during the compile process by a shell script
> in /usr/src/sys/conf/newvers.sh. This is then compiled into the kernel
> which is where uname gets it from.
Ok, I took a look at the src for this (thanks for pointing me to the
script). newvers.sh simply uses hostname, which calls gethostname(), which
calls sysctl(), so it's getting its info from the kernel as well.
This would be self-propagating, except /etc/netstart sets hostname to the
contents of /etc/myname, which means that the kernel on disk will always
have the name of the system it was compiled on, and the kernel in memory
will always contain the name of the "current" system (in /etc/myname).
So in effect, though it's not doing it directly, hostname is really
getting its info from /etc/myname. uname gets its info from the kernel in
memory as well, so we could say the same thing about it (somebody correct me
if my logic's wrong here).
As an aside, does anybody know why gethostname() returns a long when there
are only two possible return values?
> The tag in the kernel is not meant
> to show your hostname to others, rather its meant as an identifier so
> that if someone is running a kernel they have problems with they can
> type "uname -a" and see where exactly it came from: what OS, version,
> compile number, date, user, machine and path. I don't think you
> should "fix" anything, it looks ok to me.
I don't think I'll be distributing any compiled kernels, but in theory it
would be nice for somebody to be able to contact me (for which a FQDN would
be nice :) in case of problems. I guess it's just a matter of personal
preference as to what uname and hostname return (FQDN vs nodename) - I
looked around at a few systems and both are used.
To quote a net.person whose name I've unfortunately forgotten: "The
wonderful thing about standards is that there are so many to choose
- Steve -
Internet email@example.com FidoNet 1:102/852.6
Quis custodiet ipsos custodes?