Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange persistent Hostname (-s)

Status
Not open for further replies.

weipers

Technical User
Dec 3, 2002
9
0
0
US
I am building a Solaris 5.8 Netra box, which involves a fair amount of reconfiguration and rebooting. During the last phase of work, I discovered that my hostname was set to '-s'. I can change this temporarily via the hostname command, but each time the machine reboots the hostname reverts to '-s'.
I have changed all the relevant files documented within the various forums here. When the machine is booting it describes the correct host name. It is only as the machine is completing its reboot I get errors about 'My unqualified hostname (Almond)'.
I have changed/checked all the files I think I need to, including hosts, hostname, hostname.hmeo etc. I have also configured defaultdomain and defaultrouter.
Once booted, the box is unable to ping other nodes on the network.
So, first things first - where is hostname being set to '-s'?
Cheers,
 
Files to edit/change hostname manually
--------------------------------------
/etc/hosts
/etc/nodename
/etc/hostname.xxn (xxn = network interface, such as hme0)
/etc/net/ticlts/hosts
/etc/net/ticots/hosts
/etc/net/ticotsord/hosts
/etc/inet/ipnodes (if file exists and if hostname entry exists)
 
Hi,
Thanks, but I checked all these files, and they look OK to me. I still have no idea where the -s hostname comes from.
Cheers,
 
Interesting. Did you or anyone modify any of the scripts in /etc/init.d? Like inetinit or network.
 
These files were fine. I did, however, find the problem/solution.
I copied startup routines for the Oracle database and listener processes from another machine to rc3.d on this sun box. For some reason (I've yet to check it out) these routines were failing, but setting hostname to '-s'. This explains the box initially booting up as Almond, all the configuration files being set correctly, but the hostname seeming to change 'as if by magic'.
Many thanks for the help.
Cheers,
 
Many systems' hostname has a -s flag to strip off any additional domain information from the hostname that is returned. Solaris is not one of these systems, hence why your script kept setting the hostname to "-s". If you just took the -s off the end in the script, it should be fine and work as expected.
 
make a tmpdirectory copy all files mentioned above to it
issue as root: /bin/hostname newname
compare the files -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
try also: grep -w s /etc/rc*/* -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top