Operating System - HP-UX
1834447 Members
2013 Online
110067 Solutions
New Discussion

Re: hostname changes to unknown

 
Vivekanandhan
Occasional Contributor

hostname changes to unknown

I shutdown the server(L-class) for UPS maintenance.Once I restarted...hostname changed to unknown.

I got the following error messages in /etc/rc.log


Start multicast routing daemon
Output from "/sbin/rc2.d/S490mrouted start":
----------------------------
/sbin/rc2.d/S490mrouted[38]: X: The specified number is not valid for this comma
nd.

Start Internet services daemon
Output from "/sbin/rc2.d/S500inetd start":
----------------------------
/sbin/rc2.d/S500inetd[37]: X: The specified number is not valid for this command
.
Start Software Distributor agent daemon
Output from "/sbin/rc2.d/S100swagentd start":
----------------------------
ERROR: The 'swagentd' daemon started but the local hostname
'unknown' cannot be resolved, therefore no SD
commands will be able to contact it.
The most likely solution is to define 'unknown'
in '/etc/hosts'.
"/sbin/rc2.d/S100swagentd start" FAILED

Configuring all unconfigured software filesets
Output from "/sbin/rc2.d/S120swconfig start":
----------------------------
ERROR: Cannot contact the 'swagentd' daemon because the local
hostname 'unknown' cannot be resolved, therefore
no 'swconfig' or 'swremove' will be executed at this time'
The most likely solution is to define 'unknown'
in '/etc/hosts'.
"/sbin/rc2.d/S120swconfig start" FAILED
6 REPLIES 6
Vijaya Kumar_3
Respected Contributor

Re: hostname changes to unknown

Hi Vivek

Also check with dmesg and /var/log/syslog/syslog.log for any errors which caused this.
Also, check the following:

1. Do you have /etc/hosts with correct host name
2. Also check /etc/rc.config.d/netconf file for correct hostname

If nothing works, just run set_parms and set all these and reboot.

Hope this helps
vijay

Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
Vijaya Kumar_3
Respected Contributor

Re: hostname changes to unknown

Hi Vivek,

Refer "man set_parms" with hostname option, only to set up the hostname.

Are you vivek from mepz?

Thanks
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
Bill Hassell
Honored Contributor

Re: hostname changes to unknown

There are several possibilities. Have you recently applied patches to the system? There was a patch for the shells that corrected the handling of octal numbers. Some startup scripts were not correctly written and with the patch, now return an invalid number. POSIX standards define octal numbers as always starting with a zero so 07 is valid but 08 is not and produces an error. Another possibility is that someone has stored a file in one of the startup directories in /sbin (all files in /sbin/rc?.d are run automatically at bootup).

The easiest way to debug this is to run the inetd script in debug mode and save the results in a file:

sh -x /sbin/init.d/inetd > /var/tmp/inetd.log 2>&1

Then look at the logfile and search for the error message to see which command is causing the problem.


Bill Hassell, sysadmin
Tim D Fulford
Honored Contributor

Re: hostname changes to unknown

Hi

Good stuff above. Unfortunately, swagentd needs an IP to bind to & it gets it from the hostname.. (as suggested above) however, it seems that other commands failed to start you seem to have a couple of

"sbin/rc2.d/S?????[38]: X: The specified number is not valid for this command."

mrouted & inetd to name two... these may also be contributing to the problem

Tim
-
Anoop P_2
Regular Advisor

Re: hostname changes to unknown

I too is puzzled as to why the hostname should change to "unknown", just after a restart.

If a restart after applying a patch was pending, this could happen, or may be your /etc/hosts file is corrupted or unavailable!

I dont see any other reason for the hostname change!
Sridhar Bhaskarla
Honored Contributor

Re: hostname changes to unknown

Hi,

For me it looks like there is a bad configuration file out there in /etc/rc.config.d directory. Line 37 on inetd script is /etc/rc.config which does nothing but sourcing each script from /etc/rc.config.d

Make sure you don't have revisions of netconf file in that directory. One way to check is

for FILE in $(ls /etc/rc.config.d)
do
echo $FILE
. /etc/rc.config.d/$FILE
done

That should point you to the file that has the problem.

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