Table of Contents

Troubleshooting a Hanging Init Script in Solaris 8

Solaris 8 boot scripts (/etc/rc?.d/*) can hang indefinitely with almost no feedback. Below are the methods that actually work on real Solaris 8 systems.

1. Boot to Single-User Mode from OpenBoot (most reliable)

From the ok prompt:

ok boot -s

You land at the root shell (#) without most rc-scripts are not executed yet.

Now manually test the suspect script with full visibility:

# sh -v /etc/rc3.d/SxxProblemScript

or with tracing:

# sh -x /etc/rc3.d/SxxProblemScript 2>&1 | tee /tmp/debug.out

2. Force init to Drop into a Shell Early (Solaris 8 trick)

In single-user mode edit /etc/inittab and temporarily replace the initdefault line:

is:3:initdefault:

with

is:3:wait:/sbin/sh < /dev/console > /dev/console 2>&1

Reboot. init will stop after parsing inittab and give you a shell before any rc scripts run.

Then manually execute them one by one:

# for i in /etc/rcS.d/S*; do echo "=== $i ==="; sh -x $i start; done
# for i in /etc/rc2.d/S*; do echo "=== $i ==="; sh -x $i start; done
# for i in /etc/rc3.d/S*; do echo "=== $i ==="; sh -x $i start; done

When one hangs, Ctrl-C and debug it.

3. Add Logging to the Offending Script (quick & dirty)

In single-user mode edit the suspect script and put at the very top:

exec > /tmp/SxxScript.log 2>&1
set -x
echo "=== Started at $(date) ==="

Reboot normally. When it hangs again, boot boot -s, mount root if needed, and read /tmp/SxxScript.log – it shows exactly where it stopped.

4. Most Common Culprits on Solaris 8

5. Boot from CD as Last Resort

6. Quick Checklist Once You Have a Shell

# ps -ef | grep -vE "ps|grep"
# tail -50 /var/adm/messages
# grep yp /var/adm/messages
# ypwhich                     # hangs? → NIS problem
# mount -p                    # anything stuck?
# netstat -rn                 # default route present?

99 % of Solaris 8 boot hangs are either NIS/ypbind or an NFS mount without proper timeout options.