Operating System - HP-UX
1835988 Members
2434 Online
110088 Solutions
New Discussion

Re: hostname start - error

 
Karthik S S
Honored Contributor

hostname start - error

Hi,

We have a "hp-ux B.11.23 U ia64" system. the rc script hostname is giving the following error while booting. And doesn't set the hostname. I have to do it manually using uname -S host_name . How can I fix this?? Pl. help ...

./hostname start
unknown
usage: uname [-amnrsvil] [-S nodename]
EXIT CODE: 1
WARNING: OPERATING_SYSTEM is not set.
using default value of HP-UX
#

Thanks,
Karthik
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
16 REPLIES 16
Rajeev  Shukla
Honored Contributor

Re: hostname start - error

Hi,
See that you have correct name in /etc/rc.config.d/netconf or try setting the hostname by
/sbin/set_parms hostname

Rajeev
Karthik S S
Honored Contributor

Re: hostname start - error

Yeah I have already tried that. Still doesn't work.

Thanks
Karthik
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Rajeev  Shukla
Honored Contributor

Re: hostname start - error

The warning message clearly says that in /etc/rc.config.d/netconf
OPERATING_SYSTEM is not defined.
Can you recheck that at starting of netconf file you have the following entries
HOSTNAME="name"
OPERATING_SYSTEM ="HP-UX"
....

Cheers
Rajeev
Karthik S S
Honored Contributor

Re: hostname start - error

Hi Rajeev,

It already contains those parameters.

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

Regards,
Karthik
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Jeff Schussele
Honored Contributor

Re: hostname start - error

Hi Karthik,

Search for the command string in all files in all the rc dirs.

find /sbin -exec grep -l uname {} \;

May not be in netconf. Could be a stupid problem in another startup script. Maybe even a conf file - search /etc/rc.config.d as well. Something's issuing a bad uname command. Not uncommon with 3rd party SW.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
U.SivaKumar_2
Honored Contributor

Re: hostname start - error

Hi,

Check the permission of /etc/rc.config.d/netconf file should be

-r--r--r-- bin bin

check /etc/rc.config should be


-r--r--r-- bin bin

Take a copy of these files and try to use the files taken from a good working server of same HP-UX version.

regards,

U.SivaKumar





Innovations are made when conventions are broken
Rajeev  Shukla
Honored Contributor

Re: hostname start - error

Hi Karthik,

See the startup script /sbin/init.d/hostname

In this script the variable of netconf are exported and hostname is set by uname -S command

So just check this script it should have line such as..

start)
if [ -f /etc/rc.config ] ; then
. /etc/rc.config
else
echo "ERROR: /etc/rc.config defaults file MISSING"
fi

hostname $HOSTNAME
set_return

if [ -z "$NODENAME" ] ; then
uname -S ${HOSTNAME%%.*}
else
uname -S $NODENAME
fi
set_return

setuname -s $OPERATING_SYSTEM -t
set_return
;;

Cheers
Rajeev
Karthik S S
Honored Contributor

Re: hostname start - error

Hi,

The permissions are OK. Even I tried with a working copy od /sbin/init.d/hostname ( of the same OS version). Still the problem persists.

When I run the following command,
find /sbin -exec grep -l uname {} \;

it returns many file names as attached in the text file. What do I do with this output??

Thanks
Karthik

For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
James Murtagh
Honored Contributor

Re: hostname start - error

Hi,

In most of these problems the cause is a file in the /etc/rc.config.d/ directory that shouldn't be there. Check for the obvious - core files, .old extensions to files etc, otherwise attach the output of "ls -la" in that directory.

Regards,

James.
Thayanidhi
Honored Contributor

Re: hostname start - error

Hi,

Try

#/etc/set_parms hostname
or
#/etc/set_parms initial

Just a thought.

TT
Attitude (not aptitude) determines altitude.
Jeff Schussele
Honored Contributor

Re: hostname start - error

Ignore everything in the /sbin dir itself.
Concentrate on the entries in init.d & rcX.d.
What you're looking for is a malformed uname command. So man uname to undestand it's proper syntax & look for a goofball command.
Don't forget to look in /etc/rc.config.d as well.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Bill Hassell
Honored Contributor

Re: hostname start - error

If this used to work OK, look at recently changed scripts in /sbin/init.d and settings in /etc/rc.config.d with this:

ll -t /sbin/init.d
ll -t /etc/rc.config.d

Recently changed files are a good starting point. You can ignore uname commands except uname -S, and be sure to look in /etc/rc.log for error messages that ocurred dueing startup.


Bill Hassell, sysadmin
Duncan Galbraith
Frequent Advisor

Re: hostname start - error

The /sbin/init.d/hostname script that is failing sources its vars from /etc/rc.config. This then checks the config files in /etc/rc.config.d/*. Its possible that you have 2 entries for OPERATING_SYSTEM and/or HOSTNAME.
Try:
egrep "HOSTNAME=|OPERATING_SYSTEM=" /etc/rc.config.d/*

This should return only one entry for each and it shoud be in the netconf file.

Another very simple check along similar lines is:

. /etc/rc.config.d/*
echo $HOSTNAME
echo $OPERATING_SYSTEM

If this does not show what your hostname and operating system then it may be worth trying just netconf:

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

If this is still not correct examine netconf for unmatched double (") quotes. If it is now correct look in whatever other file it was that contained HOSTNAME or OPERATING_SYSTEM from the egrep command above.

Duncan
Ajit Natarajan
Valued Contributor

Re: hostname start - error

Side question:

I am a little concerned that your uname output shows 11.23. Is this a typo by any chance? No released HP-UX has a release number of 11.23.

Ajit
HP Gigabit Ethernet
Karthik S S
Honored Contributor

Re: hostname start - error

No this is a LAB Release ..!!

Karthik
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
T G Manikandan
Honored Contributor

Re: hostname start - error

how about giving

#uname -S