Operating System - HP-UX
1838670 Members
5890 Online
110128 Solutions
New Discussion

Re: Hostname after reboot

 
G.Carslow
Advisor

Hostname after reboot

Hi,

I have a L1000 running HPUX 11.0 that looses its hostname after a reboot. The script /sbin/init.d/hostname gets deleted sometime during the reboot. Hostname OK in /etc/hosts and netconf. DNS resolves alias and FQ hostname 100%. swagentd seems to be unhappy about the hostname in the rc.log file but no errors in syslog - hostname shown as unknown from start of boot in syslog.

Any suggestions appreciated.

Thanks
Greg
13 REPLIES 13
Patrick Wallek
Honored Contributor

Re: Hostname after reboot

Is the hostname defined in /etc/rc.config.d/netconf file? If not, then that is your problem. Add it in there. Is the name longer than 8 characters? It is generally best to keep the names at 8 characters or fewer in length.

Pete Randall
Outstanding Contributor

Re: Hostname after reboot

If /sbin/init.d/hostname is getting deleted during the reboot, it must be that a script in /sbin/init.d is doing it. Try running a find to search for such a script:

find /sbin/init.d -exec grep "hostname" {} \;


Pete

Pete
harry d brown jr
Honored Contributor

Re: Hostname after reboot

is your hostname defined in /etc/rc.config.d/netconf ??

To fix your /sbin/init.d/hostname file from being deleted probably requires a patch install.

live free or die
harry
Live Free or Die
Fabio Ettore
Honored Contributor

Re: Hostname after reboot

Hi,

it is very strange.
I would suggest you to set hostname by set_parms command:

#/sbin/set_parms hostname

and reboot.
Anyway what is the exact message from swagentd?

Best regards,
Ettore
WISH? IMPROVEMENT!
Pete Randall
Outstanding Contributor

Re: Hostname after reboot

This is what I come up with:

find /sbin/init.d -exec grep -l "hostname" {} \;
/sbin/init.d
/sbin/init.d/hostname
/sbin/init.d/nfs.core
/sbin/init.d/swconfig
/sbin/init.d/swagentd
/sbin/init.d/dce
/sbin/init.d/sendmail
/sbin/init.d/nis.client
/sbin/init.d/nis.server
/sbin/init.d/nisplus.server
/sbin/init.d/comsec
/sbin/init.d/vt
/sbin/init.d/vxvm-reconfig
/sbin/init.d/vxvm-rootreconfig


Pete

Pete
Geoff Wild
Honored Contributor

Re: Hostname after reboot

Yes - check the your /etc/rc.config.d/netconf file...

make sure host name is there...

When you re-create /sbin/init.d/hostname - what permissions?

ll /sbin/init.d/hostname
-r-xr-xr-x 1 bin bin 908 Nov 14 2000 /sbin/init.d/hostname

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Cesare Salvioni
Trusted Contributor

Re: Hostname after reboot

Strange problem, in my opinion it could be caused by a rm command somewhere (hard to find anyway) or, worse case, file system going really bad.

I suggest to bootstrap the host step by step, checking the rc file at every step to isolate the script causing the problem.
Boot in single mode and check the existance of file, then init 1 and check, init 2 and check.

Also could be reasonable to perform a full file system check, the problem is that is not so simple to do it on root file system, to which /sbin belongs. I suggest to start the host with the Support CDROM in recovery shell and fsck the root file system from there with the flag -o full

Hope this help
YoungHwan, Ko
Valued Contributor

Re: Hostname after reboot

Recheck
/etc/rc.config.d/netconf
/etc/hosts
and then
# export HOSTNAME=hostname
# echo $HOSTNAME
check the hostname is correct.
and then logout. login.

Another Method is
# set_parms hostname
modify your hostname and reboot.
Sridhar Bhaskarla
Honored Contributor

Re: Hostname after reboot

Greg,

One another thing to check is to see if you have any backup netconf files in /etc/rc.config.d/ directory. Every file in that directory will be 'sourced' in during the start-up. To verify it, do

$cd /etc/rc.config.d
$grep -i hostname *

You shouldn't see any file other than netconf in the above output.

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

Re: Hostname after reboot

Hi All,

Netconf hostname 100%, etc/hosts 100% as per orig post. /sbin/init.d/hostname file replaced after reboot with correct perm. and owner. Hostname configured after reboot but the same happens at next boot. Have searched /sbin/init.d with cmd: cd /sbin/init.d
find . -type f | xargs grep -i "hostname"
and then gone through each file returned to see if it could cause this. No luck..

Extracts from rc.log
Configuring all unconfigured software filesets
Output from "/sbin/rc2.d/S120swconfig start":
----------------------------
* Turning off all network based resolving services in
'/etc/nsswitch.conf'
* Setting up temporary hostname in '/etc/hosts'
* Restoring '/etc/hosts' to its original contents.
* Restoring '/etc/nsswitch.conf' to its original contents

This seems OK but ......

Starting mail daemon
Output from "/sbin/rc2.d/S540sendmail start":
----------------------------
WARNING: local host name (unknown) is not qualified; fix $j in config file
/etc/mail/aliases: 6 aliases, longest 9 bytes, 76 bytes total
sendmail
Initialize Software Distributor agent daemon
Output from "/sbin/rc2.d/S870swagentd start":
----------------------------
Running /usr/lib/sw/mx/configure to reset hostname.
NOTE: Can not find fully qualified hostname with nslookup. Using unknown.
ERROR: Failed to package AgentConfig into /var/opt/mx/depot11.
swpackage did not run or produced no output.
ERROR: Failed to package AgentConfig into /var/opt/mx/depot10.
swpackage did not run or produced no output.
WARNING: Could not properly configure SD into ServiceControl.
You may try again later by running /usr/lib/sw/mx/configure.
"/sbin/rc2.d/S870swagentd start" FAILED

....................................
I am getting the idea something in the K scripts may be the problem????Just a guess

Thanks all
Robert-Jan Goossens
Honored Contributor

Re: Hostname after reboot

Greg,

what is in the /etc/nsswitch.conf ?

Robert-Jan
Jov
Honored Contributor

Re: Hostname after reboot

Hi Greg,

Can you should us the output of:
/usr/sbin/swlist -l fileset -a state | egrep -v "^$|#|configured"


Regards

Jov
Cesare Salvioni
Trusted Contributor

Re: Hostname after reboot

Hi greg
hostname should be run on runlevel 1, in my installation START ORDER NUMBER is 320. You should see in /etc/rc.log something like:

Setting hostname
Output from "/sbin/rc1.d/S320hostname start":
----------------------------
If u have this message the file exists at boot: the problem is BETWEEN run level1 and end of rc, if not the problem could be during shutdown or from power up till runlevel 1

Another way is to start in single user mode? (hpux -is at the ISL prompt)
In single mode the file /sbin/init.d/hostname exists or not?
If it does NOT exist the problem is:
1. execing rc script during SHUTDOWN not STARTUP
2. some script BEFORE rc is started at startup, see the lines in /etc/inittab BEFORE rc

If it exists the problem is execing some rc script during startup or some script AFTER rc (again see /etc/inittab)

In case the problem is caused by rc i suggest again to run step by step checking the existance of the file every time. U can start the host in single user mode and do by hand the work of rc:
go through the run level directories (/sbin/rc1.d, /sbin/rc2.d, etc...) and run in the order indicated by number each script named S* with argument start

eg.

/sbin/rc1.d/S080crashconf start
/sbin/rc1.d/S100localmount start

every time looking if /sbin/init.d/hostname still exists

if the problem is during shutdown do the same things backwards from current level (who -r) to run level 1, following link named K*

/sbin/rc3.d/K100dtlogin.rc stop
/sbin/rc2.d/K080apache stop
always checking after each execution the /sbin/init.d/hostname file

Seems to me that other problems reported are obvious consequence to this error: hostname MUST be set up for the system to work properly.

Hope this helps