Operating System - HP-UX
1752568 Members
5339 Online
108788 Solutions
New Discussion

Re: Server Hostname Defaults To "unknown" After A Reboot

 
PHSC
Frequent Advisor

Server Hostname Defaults To "unknown" After A Reboot

Greetings.  We have an ia64 hp server rx2620 running HP-UX B.11.31

 

When the server boots up it lists the hostname as "unknown".  This causes the /etc/nsswitch.conf file to not be created and CSTM does not work etc.  The messages in the /etc/rc.log is:

 

Setting hostname

Output from "/sbin/rc1.d/S320hostname start":

----------------------------

/sbin/rc1.d/S320hostname[36]: n: The specified number is not valid for this command.

 

Now...I think I know why this has occurred.  We built this server the other day and had typed the hostname into the options screen when installing HPUX.  It turned out it was the incorrect hostname thus we simply overtyped the incorrect hostname with the correct hostname, then installed HPUX.

 

After the server boots up with the hostname of "unknown", set can set it to the correct hostname using set_parms.  The strange thing is, when doing this it thinks it knows what the correct hostname is:

 

set_parms hostname

Enter the system name, then press [Enter] or just press [Enter]

to retain the current host name (bcsstrn): bcsstrn

 

So you enter "bcsstrn" anyhow and it takes it:

 

bcsstrn # hostname
bcsstrn

 

/etc/rc.config.d

HOSTNAME="bcsstrn"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1

 

/etc/hosts

192.168.25.119  bcsstrn bcsstrn.domain.man.uk
127.0.0.1       localhost       loopback

 

But...the next time the server is rebooted it defaults back to "unknown".  Thus even after the hostname is currectly changed to "bcsstrn", the bootup changes it back. 

 

I've seen a few similar threads for this but there has been no clear resulution.  Anyone got any idears..?  Thanks

5 REPLIES 5
Patrick Wallek
Honored Contributor

Re: Server Hostname Defaults To "unknown" After A Reboot

You need to go to the /etc/rc.config.d directory and edit the 'netconf' file.  The hostname is stored there and that is where it is read from when the system boots.

 

Also make sure that you do not have a netconf.bak or any other netconf file there.

PHSC
Frequent Advisor

Re: Server Hostname Defaults To "unknown" After A Reboot

There are two netconf files in /etc/rc.config.d/

 

ll netconf*
-r--r--r--   1 bin        bin           7575 Aug 15 13:42 netconf
-r--r--r--   1 bin        bin          15737 Feb 28  2011 netconf-ipv6

 

The netconf file already has the correct hostname in there.  There are no referrences to "unknown":

 

HOSTNAME="bcsstrn"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1

 

The other file, netconf-ipv6, does not have anything much in.  I've moved this file into /tmp.

Dennis Handly
Acclaimed Contributor

Re: Server Hostname defaults to "unknown" after a Reboot

>netconf-ipv6, does not have anything much in.  I've moved this file into /tmp.

 

This is probably a normal and valid config file and should be moved back.

Patrick Wallek
Honored Contributor

Re: Server Hostname defaults to "unknown" after a Reboot

An interesting error is:

 

>>/sbin/rc1.d/S320hostname[36]: n: The specified number is not valid for this command.

 

Line 36 of the S320hostname file is where it sources /etc/rc.config, which essentially sources all files in /etc/rc.config.d.

 

The 'n: The specified number..' message indicates an error in a file.  Search through your /etc/rc.config.d directory for something that has a value of 'n'.  I think once you find that you will find your error.

Dennis Handly
Acclaimed Contributor

Re: Server Hostname defaults to "unknown" after a Reboot

>where it sources /etc/rc.config

 

You could make a copy of /etc/rc.config and instrument it so it prints out each filename before it sources it.