Operating System - HP-UX
1833744 Members
2587 Online
110063 Solutions
New Discussion

hostname changes to unknown after installing hardware patch and reboot

 
SOLVED
Go to solution
Rajesh R_2
Frequent Advisor

hostname changes to unknown after installing hardware patch and reboot

I had installed the Hardware patch bundle HWE1100_B.11.00.0403.3.depot on my HP-UX

11.0 Server and rebooted the machine. After rebooting i found that the system

hostname has changed to unknown. I checked the /var/adm/sw/swagentd.log file and it

is giving a warning as follows:

An attempt to get the network host entry for "unknown" failed.
This may result in denial of access to users and agents at
this host. Check the spelling of this name, then your
"/etc/hosts" file, or your "/etc/resolv.conf" file and DNS
resolver configuration. The nslookup program may be helpful
in isolating this problem.

Even my inetd daemon has not started after rebooting. I had to start it manually.


Kindly help me in resolving this problem.

Thanks & Regards
Rajesh
26 REPLIES 26
T G Manikandan
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

I would suggest you to do a

#set_parms initial

and do a reboot.

T G Manikandan
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Hey!

Before you do a set_parms initial.


please do the following

1.check your /etc/rc.log and see which all services have failed.

Might be there are some errors are /etc/rc.config.d scripts.

Make sure that you have no copies/revisions of file in the /etc/rc.config.d directories.

There might be multiple versions of netconf file at /etc/rc.config.d directory which is causing the prob..
Rajesh R_2
Frequent Advisor

Re: hostname changes to unknown after installing hardware patch and reboot

I am hereby uploading the rc.log file. It gives some syntax errors while starting certain serveices.
Devender Khatana
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Hi,
Hostname script itself is giving syntax error. please see this script. I think it was edited earlier, it normally do not happen because of a patch. Still did you confirmed by booting before applying pathces? You can rectify this problem yourself . Compare this files lines no.1 for some syntax errors and have a look at /sbin/init.d/template to have general idea of syntax of these files.

HTH,
Devender
Impossible itself mentions "I m possible"
T G Manikandan
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Just check whether any user scripts are present in the /etc/rc.config.d directory
Devender Khatana
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Hi Rajesh,

Just edit the files "/sbin/rc1.d/S320hostname, /sbin/rc1.d/S112kminit' and see the first line should be "#!/sbin/sh" and for files hostname and kminit in /sbin/init.d directory also it should be "#!/sbin/sh".

HTH,
Devender
Impossible itself mentions "I m possible"
Rajesh R_2
Frequent Advisor

Re: hostname changes to unknown after installing hardware patch and reboot

Hi,

I checked the scripts as suggested by devender. The first line is as you told '#!/sbin/sh'.

Manikandan, I also checked the /etc/rc.config.d/ , there are no user scripts.
Devender Khatana
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Hi Rajesh,

Which and all patches does your installation included? Can you uninstall it once and check if it works fine? Did you rebooted prior to pathch installation? It might have happened that problem actually happened earlier and came into effect on reboot.
Just a thought.

HTH,
Devender
Impossible itself mentions "I m possible"
T G Manikandan
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Can you please execute

sh -x /sbin/rc1.d/S320hostname

and check exactly what the problem is ...
Rajesh R_2
Frequent Advisor

Re: hostname changes to unknown after installing hardware patch and reboot

Hai,

Manikandan when I execute
/sbin/rc1.d/S320hostname start

I get the following error

/sbin/rc1.d/S320hostname[36]: Syntax error at line 1 : `(' is not expected.
T G Manikandan
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Do a

$set -x
$/sbin/rc1.d/S320hostname start
Devender Khatana
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Rajesh,

Backup your /sbin/init.d/hostname to hostname.bak and just copy attached file in /sbin/rc1.d directory.

It should look like.

-r-xr-xr-x 1 bin bin 908 Nov 14 2000 hostname

and /sbin/rc1.d/S320hostname should be also link to this file.


And try above step i.e. starting it manually.


HTH,
Devender
Impossible itself mentions "I m possible"
Rajesh R_2
Frequent Advisor

Re: hostname changes to unknown after installing hardware patch and reboot

Manikandan i did as u suggested. It gives the same error.

+ /sbin/rc1.d/S320hostname start
/sbin/rc1.d/S320hostname[36]: Syntax error at line 1 : `(' is not expected.
T G Manikandan
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

I am not at my office now.

Can you check the line 36 as where this script is calling

"S320hostname[36]"
T G Manikandan
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Hi Rajesh,

The problem is with your /etc/rc.config.d - hostname initialization file

check your netconf file there.

Check anything junk is present on the 1st line.

Also do not have any netconf.old or netconf.bk files in there.There should be only one file with name "netconf"

Devender Khatana
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Hi,

It is checking /etc/rc.config at line 36. So check the file /etc/rc.config for problems. The contents should like the attached file.

HTH,
Devender
Impossible itself mentions "I m possible"
T G Manikandan
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Do check any user scripts are present with hostname entries


#grep HOSTNAME /etc/rc.config.d/


Also,check as what the parameter HOSTNAME=
is set to /etc/rc.config.d/netconf file
Stephen Keane
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Do

# set -x
# . /etc/rc.config 2>&1 | tee foo.log

and post the result of foo.log

Also check that /sbin/rc1.d/S320hostname line 36 does say

. /etc/rc.config

and NOT

. /etc/config

Because . /etc/config WILL give you the error you are seeing.


Rajesh R_2
Frequent Advisor

Re: hostname changes to unknown after installing hardware patch and reboot

Devender the 36th line contains . /etc/rc.config

Also I compared /etc/rc.config with the file you sent. Both are the same.


Manikandan grep HOSTNAME /etc/rc.config.d/ shows nothing.
The parameter HOSTNAME=hptst

stepen the output of

# . /etc/rc.config 2>&1 | tee foo.log
sh: Syntax error: `(' is not expected.

Thanks & Regards
Rajesh
Stephen Keane
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

Rajesh

Did you remember the set -x ?

What is in foo.log ?
T G Manikandan
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

post the contents of foo.log
Rajesh R_2
Frequent Advisor

Re: hostname changes to unknown after installing hardware patch and reboot

sorry I did not do set -x.

the contents of foo.log after giving the command



# set -x
# . /etc/rc.config 2>&1 | tee foo.log




+ fname=LANG
+ [ -f /etc/rc.config.d/LANG -a LANG != core -a LANG = LANG ]
+ . /etc/rc.config.d/LANG
+ fname=Rpcd
+ [ -f /etc/rc.config.d/Rpcd -a Rpcd != core -a Rpcd = Rpcd ]
+ . /etc/rc.config.d/Rpcd
ksh: syntax error: `(' unexpected

Stephen Keane
Honored Contributor
Solution

Re: hostname changes to unknown after installing hardware patch and reboot

What does /etc/rc.config.d/Rpcd
look like, make sure the first charcter of the first line is a '#'.

It should look something like

# DCE RPC daemon configuration. See rpcd(1m).
#
# As of HP-UX 10.0, the NCS Local Location Broker daemon (llbd) is
# superseded by the DCE RPC daemon (rpcd). rpcd provides all of the
# LLB services that formerly were provided by llbd, and in addition,
# rpcd provides DCE Endpoint Map services. If either the rpcd rc file
# enables rpcd service or the DCE rc file enables rpcd service, rpcd
# will be started up.
#
# If START_RPCD is 1, the DCE RPC daemon (/opt/dce/sbin/rpcd) will
# be started on this host. Because the Rpcd rc file also examines this
# variable, its name should not be changed.
#
# If you plan to run any other NCS/DCE-RPC based applications on this host,
# you must start rpcd first. rpcd must fork and the parent must exit before
# other NCS applications are started. Do not use "/opt/dce/sbin/rpcd &".
#
START_RPCD=1
T G Manikandan
Honored Contributor

Re: hostname changes to unknown after installing hardware patch and reboot

check the first line in the file

/etc/rc.config.d/Rpcd