[comp.sys.sun] Hardcopy of console system

ted@braggvax.arpa (01/21/89)

>From:    Danielle Heinzer <ESC1298@ESOC.BITNET>
>I would like to have a hardcopy of the system console (either the window
>system console, and the monitor when not in window mode). And this for any
>window system (SunView, NeWS, X-Windows).
>...

Well, I'm 99% certain I can't reply to that address, so:

How about this?  If you just want the output that normally comes to
/dev/console to come to your vt100:

1) Leave the prom alone, and enable a getty on the port your terminal is on.

2) Login on the terminal, do
		script /dev/null
   to get a pty.

3) Run a program which does a TIOCCONS ioctl on fd 0,1 or 2.  This switches 
   /dev/console to your pty.  Start screen print mode on your terminal.

4) Never open a Consoletool in your window system.

This isn't ideal, (doesn't work in single user, have to log in and start
after reboot etc), but it is pretty easy, and should work.  I've done
something similar to get at kernel printfs remotely when using the
"trapopen" code I posted a while back.

	Ted Nolan
	ted@braggvax.arpa

[[ Actually, sending mail to the Bitnet is not hard from an Internet site.
Simply mail it to "user%site.bitnet@cunyvm.cuny.edu".  I should probably
use that explicit Internet address in the From field when the original
address ends in ".bitnet".  --wnl ]]

aad@stpstn.UUCP (Anthony A. Datri) (01/21/89)

The man page for cmdtool (under 4.0 at least) says that you can give it a
program to run in the window, with a default of the SHELL variable or
/usr/bin/sh.  I've not tried it, but I would imagine you could set up a
.sunview that would pipe that shell through tee, with the output going to
a dedicated printer or perhaps even an lpd queue.  It says "program" not
"shell command line", so it might not like a |, so running a simple script
with the necessary incantations should do it.  Cmdtool also seems to let
you save its text into a file, but that would require manual intervention
and wouldn't help with crashes.

None of this, of course, helps outside of suntools.  Hacking your
syslog.conf file will let you catch at least some of what you'd like to
print.

Or you could just give up these silly windowing systems, stick a DECwriter
on there like G_d intended, and learn ed........

Anthony A. Datri @SysAdmin(Stepstone Corporation) aad@stepstone.com stpstn!aad

gnb@uunet.uu.net (Gregory N. Bond) (02/08/89)

Enclosed is a little utility I hacked up to do something similar.  It is
run from our rc.local script:

	consolelog /dev/ttya /usr/logs/`hostname`

and logs all console messages to the named files.  If it is sent a SIGHUP
it will re-open all the files.  This allows a sequence like

	mv logfile logfile.old; kill -HUP pid

to trim the log.  The filename "-" is recognised as stdout and is not
reopened with a SIGHUP.

This was based on "contool" by Chuck Musciano.  (I have a similar feature
hacked into contool.)  Many thanks!

Shar and enjoy!!

Greg.
-- 
Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia
Internet: gnb@melba.bby.oz.au    non-MX: gnb%melba.bby.oz@uunet.uu.net
Uucp: {uunet,mnetor,pyramid,ubc-vision,ukc,mcvax,...}!munnari!melba.bby.oz!gnb

[[ The shar file has been placed in the archives under "sun-source".  It
is 10737 bytes long and is called "consolelog.shar".  It can be retrieved
via anonymous FTP from the host "titan.rice.edu" or via the archive
server.  For more information about the archive server, send a mail
message containing the word "help" to the address
"archive-server@rice.edu".  --wnl ]]
-- 
Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia
Internet: gnb@melba.bby.oz.au    non-MX: gnb%melba.bby.oz@uunet.uu.net
Uucp: {uunet,mnetor,pyramid,ubc-vision,ukc,mcvax,...}!munnari!melba.bby.oz!gnb