Operating System - HP-UX
1847370 Members
4785 Online
110264 Solutions
New Discussion

where does cu get the hostname?

 
SOLVED
Go to solution
Rich Wright
Trusted Contributor

where does cu get the hostname?

# cu -l /dev/tty2a1
Connected
~[sys1].

Disconnected
# hostname
sys1b

In this example, "sys1" above is not correct.
This server is an Ignite clone of sys1 where the name was changed to "sys1b".

Thanks in advance.
I promise to give 10 pts for a good answer.
19 REPLIES 19
harry d brown jr
Honored Contributor

Re: where does cu get the hostname?

I would say /etc/uucp/Systems

live free or die
harry
Live Free or Die
Kellogg Unix Team
Trusted Contributor

Re: where does cu get the hostname?

Hi,

Wow, I wasn't sure 'cu' is still being used!!
Check the following files for the old system name -
/etc/uucp/Systems
/etc/uucp/Devices
/etc/uucp/Dialers

(the above is from man-pages of cu)

HTH
...Manjeet
work is fun ! (my manager is standing behind me!!)
John Poff
Honored Contributor

Re: where does cu get the hostname?

Hi,

What does your /etc/uucp/Systems file contain?

JP
S.K. Chan
Honored Contributor

Re: where does cu get the hostname?

If cu shows the "hostname" it may be configured in /etc/uucp/Systems. Check there. Also
# man uucp
# man cu
for details. The hostname entry in "Systems" ought to be changed to match that of "hostname" output.
John Poff
Honored Contributor

Re: where does cu get the hostname?

Does a regular 'uname' command return the correct system hostname?

JP
MANOJ SRIVASTAVA
Honored Contributor

Re: where does cu get the hostname?

The cu gets it hostname from the command hostname . Do a man hostname to get the details :

The hostname command displays the name of the current host, as given
in the gethostname() system call (see gethostname(2)). Users who have
appropriate privileges can set the hostname by giving the argument
name_of_host; this is usually done in the startup script
/sbin/init.d/hostname. The name_of_host argument is restricted to
MAXHOSTNAMELEN characters as defined in .

The system might be known by other names if networking products are
supported. See the node manager documentation supplied with your
system.

WARNINGS
If the name_of_host argument is specified, the resulting host name
change lasts only until the system is rebooted. To change the host
name permanently, run the special initialization script
/sbin/set_parms (see Using Your HP Workstation).

Many types of networking services are supported on HP-UX, each of
which uses a separately assigned system name and naming convention.
To ensure predictable system behavior, it is essential that system
names (also called host names or node names) be assigned in such a
manner that they do not create conflicts when the various networking
facilities interact with each other.

The system does not rely on a single system name in a specific
location, partly because different services use dissimilar name
formats as explained below. The hostname and uname commands assign
system names as follows:

+--------------+--------------+---------------+-----------------------+
|Node Name |Command |name Format |Used By |
+--------------+--------------+---------------+-----------------------+
|Internet name |hostname name |sys[.x.y.z...] |ARPA and NFS Services |
|UUCP name |uname -S name |sys |uucp, related programs |
+--------------+--------------+---------------+-------- --------------+

where sys represents the assigned system name. It is strongly
recommended that sys be identical for all commands and locations and
that the optional .x.y.z... follow the specified notation for the
particular ARPA/NFS environment.

Internet names are also frequently called host names or domain names
(which are different from NFS domain names). Refer to hostname(5) for
more information about Internet naming conventions.

Hewlett-Packard Company - 1 - HP-UX Release 11.00: October 1997

hostname(1) hostname(1)

Whenever the system name is changed in any file or by the use of any
of the above commands, it should also be changed in all other
locations as well. Other files or commands in addition to those above
(such as /etc/uucp/Permissions if used to circumvent uname, for
example) may contain or alter system names. To ensure correct
operation, they should also use the same system name.

System names are normally assigned by the /sbin/init.d/hostname script
at start-up, and should not be altered elsewhere.

AUTHOR
hostname was developed by the University of California, Berkeley.

SEE ALSO
uname(1), gethostname(2), sethostname(2), uname(2), hostname(5).

Using Your HP Workstation

Hewlett-Packard Company - 2 - HP-UX Release 11.00: October 1997



Manoj Srivastava
Rich Wright
Trusted Contributor

Re: where does cu get the hostname?

grep sys1 /etc/uucp/* does not match anything.

uname -a shows "sys1b" for host name.

Contents of /etc/uucp/System
# cat Systems

nwuxd Any ACU 1200 chicago2600776 in:--in: nuucp word: panzer
gspiport Any;5 gspiport,f 9600 - "" \r\d\r\d\r ogin:-BREAK-
ogin: uucp asswrd: uucp-BREAK-ogin: uucp asswrd: uucp

John Poff
Honored Contributor

Re: where does cu get the hostname?

Ok. What kind of modem are you using? If you are just issuing the 'cu -l ...' command without specifying a host, could that hostname be coming from the modem itself? You aren't using the HP support dial-in modem, are you?

JP
John Poff
Honored Contributor

Re: where does cu get the hostname?

Try setting the hostname like this:

uname -S sys1b



Here is a snippet from the hostname man page:

The system does not rely on a single system name in a specific
location, partly because different services use dissimilar name
formats as explained below. The hostname and uname commands assign
system names as follows:

+--------------+--------------+---------------+-----------------------+
|Node Name |Command |name Format |Used By |
+--------------+--------------+---------------+-----------------------+
|Internet name |hostname name |sys[.x.y.z...] |ARPA and NFS Services |
|UUCP name |uname -S name |sys |uucp, related programs |
+--------------+--------------+---------------+-------- --------------+


It looks like uucp relies on the setting from uname -S for the hostname.

JP


Rich Wright
Trusted Contributor

Re: where does cu get the hostname?

Well, no luck so far.
I tried "uname -S sys1b".

The idea of it coming from the modem is tempting except that it happens on lines with no modems attached.

BTW, this is a 8-port PCI-MUX on an N4000. Modems at attached to ports 1-3.

Perhaps the following debug output from cu will jog someones memory.

# cu -d9 -s 9600 -l /dev/tty2a2
call dial(2063535056)
baud=9600, speed=9600, line=(null), telno=(null)
call find_dev(17277605720)
baud=9600, speed=9600, line=(null), telno=(null)
nomodem is 1
fixline(4, 9600)
fixline - direct
MDTR was not set
gdial(direct) called
call mode(1)
Connected
transmit started
receive started
~[sys1].
call tilde(.)
call quit(0)
call bye(0)

Disconnected
call hangup(0)
call undial(5)
Lock-file unlinked
call mode(0)

Rich Wright
Trusted Contributor

Re: where does cu get the hostname?

I have not rebooted since "uname -S sys1b".
Also, I have no idea where the phone numbers showing in the debug output are coming from.
John Poff
Honored Contributor

Re: where does cu get the hostname?

Have you checked the hostname in the GSP?

Here is a link to a thread that talks about how to change it:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x9d9793e260b0d611abdb0090277a778c,00.html


JP

John Palmer
Honored Contributor

Re: where does cu get the hostname?

cu gets the hostname from the 'uname -S ' not from 'hostname'.

You can test it by changing the uname -S name and trying cu again.

Both the hostnames are set from the HOSTNAME variable in /etc/rc.config.d/netconf when the system is rebooted but you don't need to reboot to change it.

In this case, did you boot the system as 'sys1' and then change the name with 'hostname sys1b'?

Regards,
John
Kellogg Unix Team
Trusted Contributor

Re: where does cu get the hostname?



Are you connecting from sys1b to sys1 or to sys1b itself? Once connected, what does 'uname' and '~!uname' return? Also, what does 'uuname' return on sys1 and sys1b?

...Manjeet
work is fun ! (my manager is standing behind me!!)
Rich Wright
Trusted Contributor

Re: where does cu get the hostname?

The GSP host name is completly different (GSP-cons1)

The hostname is set to sys1b.
uname -S sys1b
does not change the results.
I still get ~[sys1]. display from cu when entering ~. to exit.

I also rebooted to install the latest PCI-MUX patch.

John Palmer
Honored Contributor
Solution

Re: where does cu get the hostname?

cu does appear to limit the uname -S hostname to 7 characters. If sys1 is your real hostname then this doesn't apply but if it were an 8 character name then the the last character would be lost.

What happens if you try a completely different name in uname -S ?

Regards,
John
John Poff
Honored Contributor

Re: where does cu get the hostname?

Here is another crazy thing to check for. In your /etc/rc.config.d directory, do you have any copies of the netconf file hanging around (netconf.old, netconf.1031, etc.)? I wonder if there is an extra copy in there that could be hosing things up.

I got on one of our test systems here and played with changing the hostname via 'uname -S newname'. Nobody else was on the box and pretty much nothing is running. I touched a file before the 'uname -S', and I did a 'find / -newer myfile' afterwards, and it didn't show any real files changing from the 'uname -S' command, even after doing a couple of 'sync' commands for good measure. The netconf file has comments that say the HOSTNAME= entry is for 'uname -S', but mine didn't change. Weird!

JP

Rich Wright
Trusted Contributor

Re: where does cu get the hostname?

Thank You John!

sys1/sys1b were pseudonyms.

The real names were 7 & 8 characters long.

Thanks to all who responded!
Richard Steven
Advisor

Re: where does cu get the hostname?

Why not just perform a find on every text file on the system?

# find / -type f -exec grep sys1 /dev/null {}\;

I hope my syntax is ok!

Regards :-)
If you don't ask you don't get!