[net.unix] How do I set the nodename field in USG 3.0 Unix uname?

bsa@ncoast.UUCP (Brandon Allbery) (07/30/85)

We have just upgraded to Microsoft Xenix 3.0, which is near enough to USG 3.0
as no matter.  News software, when compiled for USG, looks at the return status
of the uname(2) system call (around MS they call it uname(S), but it's the same
call).

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?

Thanks in advance,

--bsa (new at this nonsense)
-- 
Brandon Allbery, Unix Consultant -- 6504 Chestnut Road, Independence, OH 44131
decvax!cwruecmp!ncoast!bsa; ncoast!bsa@case.csnet; +1 216 524 1416; 74106,1032
========================> Trekkies have Warped minds. <=======================

chris@que.UUCP (Chris DeVoney) (07/31/85)

> We have just upgraded to Microsoft Xenix 3.0, which is near enough to USG 3.0
> as no matter.  News software, when compiled for USG, looks at the return status
> of the uname(2) system call (around MS they call it uname(S), but it's the same
> call).
> 
> 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?
> 
> Thanks in advance,
> 
> --bsa (new at this nonsense)
> -- 
> Brandon Allbery, Unix Consultant -- 6504 Chestnut Road, Independence, OH 44131
> decvax!cwruecmp!ncoast!bsa; ncoast!bsa@case.csnet; +1 216 524 1416; 74106,1032
> ========================> Trekkies have Warped minds. <=======================

I have done this for XENIX. I have mailed the instruction to Brandon. If
you would like a copy (the instructions are somewhat verbose), e-mail a request
and I'll e-mail it back rather than clutter this group. If enough requests come
in, I'll post.


Chris DeVoney				voice: 317/842-7162
Que Corporation				uucp:  ihnp4!inuxc!que!chris
Indianapolis, IN 

#include <trademarks.all>		/* you know what these are for */
#include <disclaimer.all>

itkin@luke.UUCP (Steven List) (08/03/85)

In article <821@ncoast.UUCP> bsa@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
***