A journey to the center of boot

Liane Praza’s Weblog:
A journey to the center of boot

With the tools that smf(5) brings, you can now watch boot from the inside. Well, at least the user-land part of boot.

I personally think it is pretty cool to watch the system come up bit by bit, but perhaps not everyone shares my overdeveloped sense of wonder at a service graph. Watching boot happen is also actually useful if you’re finding you can’t get a console login prompt. We make a concerted effort with smf to drop you to a root password prompt if something goes wrong, but there are some cases where the system appears hung and there’s no login prompt to be seen. They’re rare, but not completely impossible.

At the boot prompt (ok on sparc, Select (b)oot or (i)nterpreter: on x86), type b -m milestone=none. That’ll get you to here:

Select (b)oot or (i)nterpreter: b -m milestone=none
SunOS Release 5.10 Version gate:2005-01-10 32-bit
Copyright 1983-2005 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
DEBUG enabled
Booting to milestone "none".
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run

Root password for system maintenance (control-d to bypass):

Log in. If you run svcs now, you’ll note that all services are disabled or uninitialized. The disabled services are temporarily disabled by svc.startd because that’s how we implement running in a limited milestone: we temporarily disable all services that aren’t part of that milestone’s subgraph. The uninitialized services are managed by a different restarter than svc.startd. Their restarters haven’t shown up yet to manage their state, so they remain uninitialized.

Now, to start up the rest of the system. Run svcadm milestone all, then use svcs to watch your system start up. I won’t post examples here, as this is really easy to try yourself. If you’re looking to debug a specific problem, wait until the svcs output stabilizes, then run svcs -x to see what services are causing trouble. Look at the services’ logfiles for more details on what’s going wrong.

Finally, when you’re done poking around, just exit the login shell to resume normal console login.

[composed and posted with ecto]

Leave a comment

Please be polite and on topic. Your e-mail will never be published.