Quoth prasad on Mon, May 08, 2006 at 09:08:38AM -0700: > - We have implemented the above dependencies in pre Solaris 10 using > run level scripts and exited when there was a fatal failure by doing > a "exec ksh -o vi" which took us to a console prompt where we could > debug the issue > > In Solaris 10 FCS and SMF world, we have kludged our run level scripts by > doing the following: > - sourced /lib/svc/share/smf_include.sh so that we can write to the > console using "echo msg | smf_console" > - since S99dtlogin is not a SMF service yet, we could exit to the > console prompt using "exec /bin/ksh -o vi </dev/console >/dev/console > 2>&1" > > One of the problems we face now is that when we exit it to the console > prompt during a fatal error, it seems to be unfriendly for debugging > i.e. can't use vi for long (maybe it has some buffer) and the "console > login message" appears constantly.
Indeed, interactive rc scripts don't work anymore. For your goals, instead of exec'ing a shell on failure, I would echo a message to smf_console and then while true; do sleep 1800 done Eventually the service will time out and svc.startd will put it into maintenance. I believe system/console-login is independent of multi-user, so you should get a login prompt, and then if you saw the error message you could begin debugging. If console-login depends on multi-user somehow, then when it enters maintenance, svc.startd should start sulogin, which will let you log in and debug. Sleeping until timeout is inefficient, but unfortunately svcadm mark -I maintenance doesn't work right now. You could kill all of the processes in the contract, if you're willing to do some scripting. > In future releases of Solaris 10, dtlogin maybe a service which means > that my fatal exits in my rc2.d scripts would not work? What are my > options to implement my custom scripts? In snv_39, at least, cde-login depends on multi-user, which runs the rc2.d scripts. So if it goes into maintenance, then dtlogin will not be started. David