Blog dedicated to Oracle Applications (E-Business Suite) Technology; covers Apps Architecture, Administration and third party bolt-ons to Apps

Saturday, December 27, 2008

Solaris refuses to boot

Recently one of the Solaris servers which was down for maintenance by unix team, refused to boot.

While searching for a solution to this problem I came across the Nick Grossman's article How to get Solaris Box Online which is something anyone working with Solaris as the OS should know. I am pasting it below:

How to get a Solaris Box Online

Notes:
  1. I've done this many times on Solaris 2.6. Other versions may or may not be different and may or may not work.
  2. The following assumes a static IP address, a full-time Ethernet network connection, and the desire to use DNS for name resolution.
  3. This information is provided as a courtesy. It may or may not be accurate and it may or may not work for you. Use at your own risk.


1. Log in as root

2. cd /etc

3. Edit /etc/hostname.hme0

This file should contain the hostname of your machine, without the domain name. So, if the FQDN (Fully Qualified Domain Name = hostname + domain name) is solaris-box-1.yourdomain.com, the file should look like this:

# cat hostname.hme0
solaris-box-1

This assumes that your Ethernet adatper is hme0, the default device name for the first Ethernet adapter—the filename format is hostname.. On Solaris 10, it's iprb0, so you need to edit /etc/hostname.iprb0 instead. (Thanks to Robin Joinson for supplying the Solaris 10 info!)

4. Set up your /etc/hosts file.

It should look something like this:

127.0.0.1       localhost
192.168.0.150 solaris-box-1 solaris-box-1.yourdomain.com loghost

Make sure the second line has the correct IP address, hostname, and FQDN. The first line is the loopback entry. Along with #5, Solaris will know its name and IP address.

5. Create or edit /etc/nodename

Contains the hostname of the computer (same as hostname.hme0).

# cat nodename
solaris-box-1


6. Create or edit /etc/defaultrouter

Surprisingly enough, this file contains the IP address of your default router (or gateway). When you reboot and the network initialization scripts run, it will add a default route to the IP address in this file.

# cat defaultrouter
192.168.0.1


Now it knows about it's own network parameters and it's time to get it to use DNS. The next steps will tell it to use other nameservers. If you want to set up a nameserver on the local machine, see the man page for named.


7. Edit /etc/nsswitch.conf

If you haven't edited this file before, it should look suspiciously like like this:

passwd:     files
group: files
hosts: files
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system will
# figure it out pretty quickly, and won't use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
sendmailvars: files

Add the word 'dns' after 'files' on the 'hosts' line:

passwd:     files
group: files
hosts: files dns
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system will
# figure it out pretty quickly, and won't use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
sendmailvars: files

Now it knows to query a nameserver when looking up a name. Next we have to tell it what nameservers to use:


8. Create or edit /etc/resolv.conf

Here you tell it three things:

  1. What domain we're in
  2. Specify any additional search domains
  3. What the nameservers are (it will use them in the order you put them in the file)

When you're done it should look something like this:

# cat resolv.conf
domain yourdomain.com
search yourdomain.com
search client1.com
nameserver 192.168.0.9
nameserver 192.168.0.11

For more information, see the man page for resolv.conf.


9. Reboot or re-initialize networking

# sync;sync;sync
# reboot
OR
# /etc/init.d/network
# ifconfig -a
(Thanks to Michael Hicks for the non-rebooting method!)

You should now be normally online. If not, check everything above; if it's correct, try

  1. ping your gateway
  2. ping a machine on your local network
  3. ping your nameservers
  4. ping a well-known host, like www.yahoo.com

10. Go to www.sunfreeware.com and download some stuff.

They maintain a fairly comprehensive archive of free software precompiled for various versions of Solaris. It'll make your life a lot easier, especially if your home environment is Linux.

Packages I suggest are:

Program Function
joe editor
pico editor (required to run pine w/o any additional configuration)
pine email client
gzip file compression
tar GNU tar, more flexible and includes gzip file compression
gcc GNU C compiler
gdb GNU debugger
top memory monitoring tool
perl scripting language
bash shell
apache web server
less text paginator (use instead of more)

That's about it. If you have any comments or corrections, please email me at nick@pantsblazing.com.



Author: Nick Grossman
Last Updated: 5/30/2000

No comments: