David Bustos wrote:

>Quoth Darren Reed on Thu, Jun 15, 2006 at 04:43:44PM +0800:
>  
>
>>While I'm thinking of useful changes to SMF, can it capture all
>>output sent to the console, directly, by services?
>>
>>So if the startup scripts for a service do 'echo foo > /dev/console',
>>can that be captured?
>>    
>>
>
>Technically, service scripts are supposed to pipe such messages to the
>smf_console() function defined in /lib/svc/share/smf_include.sh .  Then
>you can define $SMF_MSGLOG_REDIRECT to direct the messages to a file.
>This won't get binaries which write directly to the console, though.
>For that, you'd need a generic console capture mechanism.  consadm & cvc
>redirect, but it looks like they don't capture.
>  
>

There's an ioctl somewhere for things like "xterm -C" and
xconsole but that is too complete.  I still want to be able to
login to the console if I have to ;)

What about a chroot(2) equivalent for /dev/console?

>>And further to this, is it possible to generate a single output
>>file of all of the stdout/stderr from services as they boot up?
>>
>>Although this can be something like a plate of scrambled eggs,
>>it can be useful to have in a single place all of the output from
>>services started (or attempted to start) at bootup, in an order
>>that is roughly equivalent to that in which they were generated in.
>>Yes, I've seen this mode of operation elsewhere but they only had
>>a more developed SVR4 rc system, not SMF.
>>    
>>
>
>Is this just to debug service startup-order problems?
>  
>

I hadn't thought of this, I was just considering was it possible
for SMF to trap the output of all the services it was responsible
for and make sure it all ends up in the appropriate log file,
even if the startup hasn't been write as safely as it should.

Darren


Reply via email to