How do I set the nodename field in USG 3.0 Unix uname?

Steven List itkin at luke.UUCP
Sun Aug 4 06:37:58 AEST 1985


In article <821 at ncoast.UUCP> bsa at ncoast.UUCP (Brandon Allbery) writes:
>My question is, should I patch uname.c to compile in the fake uname(), or
>else how do I go about informing the kernel of our node name?

I'm not sure about your system.  Plexus provides a program called
`dconfig(8)' that updates the information in block zero on the disk.
Block zero is read by the kernel during boot to determine such things as
logical disk configuration, swap space, and node name.  I'm pretty sure
that it's Plexus specific.  That block is described on this system in
/usr/include/sys/disk.h.  Maybe there's something similar on your
system.

A method I use when I need to change the system node name dynamically
(the other only works across a boot) is a little program called
`setnode'.  Yes, in all modesty, I wrote it myself.  It looks for a
structure called utsname in the kernel memory, one element of which is
the node name (also included are the other three parts of what shows up
in the `uname -a' call).  Since the uname(1) call is standard UN*X, this
is also probably common.  Anyway, the program finds the structure with
an nlist(2) call and then updates and rewrites it.  This does not
permanently change the node name, just in memory.  To make it
(relatively) permanent, setnode could be run from /etc/rc.

If there is any interest in my program, I'll post it to mod.sources.  I
haven't thus far since I haven't felt that there would be widespread
need for it.

Let me know by mail if there's interest.
-- 
***
*  Steven List @ Benetics Corporation, Mt. View, CA
*  Just part of the stock at "Uncle Bene's Farm"
*  {cdp,greipa,idi,oliveb,sun,tolerant}!bene!luke!itkin
***



More information about the Comp.unix mailing list