Operating System - HP-UX
1831319 Members
3110 Online
110023 Solutions
New Discussion

wrong hostname after reboot

 
SOLVED
Go to solution
The_Cina
Advisor

wrong hostname after reboot

Hello,

This weekend I have reboot the 1st of our Service Guard cluster node and what happened is the following:
Once rebooted the server, it came up with a different hostname.the hostname was the same as the second cluster's node hostname.
I have changed the hostname back to the right one by issuing "hostname "
But still the uname -n returns the wrong hostname.

Any idea why the hostname is wrong?

Thanks,
8 REPLIES 8
Jeff_Traigle
Honored Contributor

Re: wrong hostname after reboot

You can fix the uname output by running "uname -S ".

As for why it was set wrong on reboot, that's controlled in /etc/rc.config.d/netconf by the HOSTNAME variable. There are other places where the hostname is stored (e.g. /etc/hosts) so your best bet may be to run "set_parms hostname" to be sure they all get set appropriately. This requires a reboot, however.
--
Jeff Traigle
The_Cina
Advisor

Re: wrong hostname after reboot

Thanks Jeff,

- /etc/rc.config.d/netconf : reports the right hostname
- /etc/hosts reports all the right hostnames
- set_parms hostname : I did set it once, but after I did another reboot, it still came up with the wrong hostname.

I'm tryng to find out where the hostname get set wrong... This is a Service Guard Cluster, but I don't think it has something to do with the cluster functionality...

still looking..
James R. Ferguson
Acclaimed Contributor
Solution

Re: wrong hostname after reboot

HI:

There are two things I would check.

First, make sure that you don't have your 'HOSTNAME' variable set in two files in '/etc/rc.config.d'. The last one source will "win". Please read the short documentation in '/etc/rc.config' for legal backup file names!

Second, make sure that you are not setting the 'NODENAME' variable when the files in '/etc/rc.config.d' are sourced by '/etc/rc.config' during startup.

An easy way to see this is to do:

# . /etc/rc.config
# set | grep -e NODENAME -e HOSTNAME

The NODENAME is used when it defined and '/sbin/init.d/hostname' runs during startup.

Regards!

...JRF...
The_Cina
Advisor

Re: wrong hostname after reboot

Thanks James,

I saw your posts in other forums regarding this issue, and it seems to be my problem.

I'm disappointed on how rc.config handles the backup files... but the only thing I can do is accept it and take as a lesson.Good to know for the next time !!

Thanks again for your fast help!!
YAQUB_1
Respected Contributor

Re: wrong hostname after reboot

Hi The Cina,

Please go through the below URL site, before doing any things:-

http://forums12.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1206983975696+28353475&threadId=245584

Hope it will very help full for U.

Best of luck,

Thanks--Yaqub
HP Support!!!
James R. Ferguson
Acclaimed Contributor

Re: wrong hostname after reboot

Hi (again):

> I'm disappointed on how rc.config handles the backup files

I would *NOT* be disappointed, only enlightened. This is documented in '/etc/rc.config': " Filenames containing [.,~#] are not sourced - they are possible names of # backup files such as file.bak, file.OLD, ~file, file~, file,v, #file etc."

Regards!

...JRF...
The_Cina
Advisor

Re: wrong hostname after reboot

Well, now I see the light ;-)

Thanks again you all !
bye
The_Cina
Advisor

Re: wrong hostname after reboot

Proposed solution was straight to the problem. Problem solved.