11.31 hostname change issue (506 Views)
Reply
Trusted Contributor
Dave Chamberlin
Posts: 558
Registered: ‎04-10-2000
Message 1 of 4 (506 Views)

11.31 hostname change issue

       Greetings, running hp-ux 11.31 on PA-RISC rp7420. I was shown a way to change the hostname on 11.31 by 1) editing the /etc/hosts file with the new name, 2) editing the /etc/rc.config.d/netconf with the new name then running /sbin/init.d/hostname start. I have done this several times in the past now, but recently, the hostname is not changed doing this. A uname or hostname command shows the original hostname. If I run set_parms hostname though, it indicates the hostname has already changed and I have the option to keep it or change it. Either way - after running set_parms, the name really is changed - as verified by uname and hostname.

       More curious - I can revert to the original hostname with the initial procedure (ending with /sbin/init.d/hostname start) and do not need to run set_parms.

       Can someone explain this behavior?  thanks

 

Honored Contributor
Matti_Kurkela
Posts: 6,271
Registered: ‎12-02-2001
Message 2 of 4 (489 Views)

Re: 11.31 hostname change issue

What is the length of the new hostname? Is it longer than the old one? Longer than 8 characters?

 

Old versions of HP-UX had a hostname length limit of 8 characters. Then it became possible to extend the hostname beyond 8 characters, but if you did that, you had to also specify a 8-characters-or-less version as a "nodename", to be used by UUCP utilities and possibly other legacy stuff. When the hostname was 8 characters or less, the convention was for the nodename to be automatically set equal to the hostname.

 

In 11.31, even the nodename can be extended beyond 8 characters, but you must activate certain configuration options to do so. It's possible that set_parms includes the functionality to make the necessary configuration changes automatically, while the other ways to change the hostname do not.

 

MK
Trusted Contributor
Dave Chamberlin
Posts: 558
Registered: ‎04-10-2000
Message 3 of 4 (474 Views)

Re: 11.31 hostname change issue

the length of the new hostname was 7 chars, the old was 6 chars

Honored Contributor
Robert_Jewell
Posts: 1,239
Registered: ‎06-26-2001
Message 4 of 4 (467 Views)

Re: 11.31 hostname change issue

If you look at what the /sbin/init.d/hostname script is doing, it is first sourcing the configuration files within the /etc/rc.config.d/ as specified by /etc/rc.config.  This will get the HOSTNAME value from the netconf file.

 

(Do you happen to have multiple 'netconf*' files in the /etc/rc.config.d directories?)

 

This value is passed to the 'hostname' and 'uname -S' commands to set the name of the host.

 

Run the following to show what the hostname script is doing:

 

  # sh -x /sbin/init.d/hostname start

 

Look for the line HOSTNAME=xxxxxxx and then the commands being used.

 

 

-Bob

 

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.