Operating System - HP-UX
1833327 Members
2779 Online
110051 Solutions
New Discussion

Re: Couldn't change system name

 
SOLVED
Go to solution
ChuanH
Regular Advisor

Couldn't change system name

Hi all,
I have a strange problem that I really need to get the help from you.
My system is HP-UX B.11.00 U 9000/800 138901587 unlimited-user license , the last patch is PHSS_23823.
old system name: unixh100
new system name: unixh145 ( no ip change)
Application: CiscoWorks 2000
No DNS enabled

I used the set_parms initial to change the system name to unixh145,then reboot the box, but the system name is still unixh100 when it back, I check the /etc/hosts and /etc/rc.config.d/netconf, there are only unixh145 there no unixh100 exist in these file.
Checked from SAM, the system name was still unixh100, change it to unixh145 and exit SAM, logout and login again, system name is unixh145 now; But if I reboot the box, it will still be unixh100.
If you need more messages please let me know,


Any suggestions will be appreciated!

Thank you!

Vic

Knowledge is Power
16 REPLIES 16
John Poff
Honored Contributor

Re: Couldn't change system name

Hi Vic,

Check to make sure that you don't have any extra copies of netconf in your /etc/rc.config.d directory (netconf.save, netconf.old, etc.) One of our guys got bitten by this problem a few weeks ago when he had made a copy of the netconf file in /etc/rc.config.d. The rc script will include all the files in that directory, so any copies will get included after the regular file.

JP
Sridhar Bhaskarla
Honored Contributor

Re: Couldn't change system name

Hi,

set_parms should change the system name.

During the system bootup process, the hostname is setup with the rc scripts /sbin/init.d/hostname. So try running the script "/sbin/init.d/hostname start" after the system came up with the old hostname.

I feel that there might be someother III party rc script that is hardcoded with your old hostname running "hostname" command later.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Tom Maloy
Respected Contributor

Re: Couldn't change system name

set_parms hostname

should have been sufficient. Also check /etc/hosts and /etc/net/*/hosts.

HTH

Tom
Carpe diem!
Jordan Bean
Honored Contributor

Re: Couldn't change system name


Try this:

. /etc/rc.config.d/netconf
echo $HOSTNAME

If it returns the old name, then see how many times HOSTNAME= appears in the netconf file? On special occasions I've found a redundant set of variables at the end of the file clobbering everything else at the top.



Jordan Bean
Honored Contributor

Re: Couldn't change system name


Good call, Poff. As a rule, never keep such copies in the same location. However, if you ever need to, they must be preceded by dot, comma, tilde, or hash ([.,~\#]) as dictated by /etc/rc.config.

Kelli Ward
Trusted Contributor

Re: Couldn't change system name

Hi John,
Isn't that funny. I just saw the same thing on a coworkers test(play) system where he generated a .old backup of the netconf file and it kept changing the hostname back on him. Poor guy played with it for a couple of days before asking for help.
I'd never seen this before, but it made for a cute learning experinece.

Hi Vic,
Sounds like John my be on the money.

Good luck to you,
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
David Andrews_1
Advisor

Re: Couldn't change system name

NOTE: If you use Omniback, you will have to do additional work, because the hostname is used for the Omniback Cell Name.

I have attached a file containing the stages required.
ChuanH
Regular Advisor

Re: Couldn't change system name

Thanks all for your helpful message!
The problem is still there.
This is what I did after I got your suggestion:

1. replaced unixh100 with unixh145 in the following files:
/etc/net/ticlts/hosts
/etc/net/ticots/hosts
/etc/net/ticotsord/hosts


2. transfer /tmp/netconf.901 and /tmp/netconf.back to another box ( these 2 files been removed from /etc/rc.config.d/ to /tmp on last Friday), rm these 2 files on this box;

3. Stop the applications and ITO agents , reboot the box, the system is still unixh100,
try following:
. /etc/rc.config.d/netconf
echo $HOSTNAME ( the response is unixh145 )

I would like to supply more system information if necessary,

Thanks again!


Vic




Knowledge is Power
Jordan Bean
Honored Contributor

Re: Couldn't change system name


Has the hostname been hardcoded by chance in /sbin/init.d/hostname in the start section around line 41?

Jordan Bean
Honored Contributor
Solution

Re: Couldn't change system name


Have you looked at the other config files for the variable HOSTNAME?

grep -l HOSTNAME /etc/rc.config.d/*

Hopefully you only get the netconf file.

ChuanH
Regular Advisor

Re: Couldn't change system name

Thanks Jordan!
Is there something wrong with this output?

unixh145-root@ /sbin/init.d > grep -l HOSTNAME /etc/rc.config.d/*
/etc/rc.config.d/netconf
/etc/rc.config.d/redconf

Could you please check the attached file for me?

Thanks a lot

Vic

Knowledge is Power
John Poff
Honored Contributor

Re: Couldn't change system name

Hi Vic,

What is the /etc/rc.config.d/redconf file, and why does it have an entry for HOSTNAME in it?

JP
Jordan Bean
Honored Contributor

Re: Couldn't change system name


I assume the script you attached is /sbin/init.d/hostname. It's fine.

The problem is most certainly with the redconf file. Let's have a look at it. I suspect that HOSTNAME is being set in it. Because most rc scripts use /etc/rc.config to source ALL files in /etc/rc.config.d in alpanumeric order, redconf will be processed after netconf, thus overriding that value that you want. Please attach the redconf file.
ChuanH
Regular Advisor

Re: Couldn't change system name

Thanks a lot for all of your advise!

Looks like there is a ghost been killed by one of you guys :) :). I reboot at least 5 times from Sep. Last Friday when I rebooted it again,
my system came to unixh145 now! ow ow!

Best regards,

Vic
Knowledge is Power
John Poff
Honored Contributor

Re: Couldn't change system name

Hi Vic,

I'm glad your problem is solved, but I'm always happier when I know what was wrong. I'm willing to bet an ice cold alcoholic beverage that your /etc/rc.config.d/redconf file isn't there any more. :)

JP
ChuanH
Regular Advisor

Re: Couldn't change system name

Thanks John,
/etc/rc.config.d/redconf is still there without unixh100 inside. :)

Best regards,

Vic
Knowledge is Power