====== 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 ===== * NIS/ypbind hanging because master/slave is unreachable (''ypwhich'' hangs) * NFS mounts in ''/etc/vfstab'' without ''bg,intr,soft'' when server is down * ''route add default ...'' when gateway is unreachable * ''/etc/rcS.d/S92volmgt'' starting ''vold'' (waits forever if RPC is broken) * ''S69inet'' starting ''in.routed'' or ''in.rdisc'' * ''keyserv'', ''automount'', or anything waiting for NIS * Old Sun Cluster scripts accidentally left enabled ===== 5. Boot from CD as Last Resort ===== * Boot Solaris 8 CD → single-user * Mount root disk under ''/a'' (usually ''/dev/dsk/c0t0d0s0'') * Rename or edit the bad script under ''/a/etc/rc?.d/'' ===== 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.**