My original question was:
I have a SPARCstation IPC that run some graphic programs. For this
program,
I want to use it full screen but I also want to see any messages from
console.
And I have a terminal next to this IPC.
Is there a way to redirect message from console to this terminal?
What you want to do is edit file /etc/syslog.conf. Change the lines that
direct messages to /dev/console to the device you want.
And many answers recommended Contool. This is very good program that I
use as console. It does very nice filtering console message.
There's also many small C-program that do the job as follow:
========================================================================
Hi Khantipol,
I send you a small c-programm that I am using to divert the console
from my server ( which is on ttya) to a window on my workstation
This is also only a temporary diverting of the console.
Greeting. Ciao Ray
/* program handed out by Dick St.Peters, GE Corporate R&D, Schenectady, NY
stpeters@dawn.crd.ge.com */
/* modified from Bob Darrow's code */
#include <stdio.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/file.h>
main(argc, argv)
int argc ;
char **argv ;
{
int foo, des ;
char *tty = "/dev/tty" ;
if (argc > 1)
tty = argv[1] ;
if((des = open(tty, O_RDONLY)) == -1)
{
perror("open") ;
exit(0) ;
}
if(ioctl(des, TIOCCONS, &foo) == -1)
perror("TIOCCONS ioctl") ;
}
========================================================================
here is a C programme that redirects console messages to ttya
I hope this helps
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
main()
{
int fd;
if (fd=open("/dev/ttya",O_RDWR)<0){
fprintf(stderr,"unable to open ttya\n");
exit(1);
}
if (ioctl(fd, TIOCCONS, NULL) == -1) {
fprintf(stderr, "could not attach %s to /dev/console\n", "/dev/ttya");
exit(1);
}
}
============================================================================
This might work...
Log in on the terminal and compile and run the following program...
main() {
if ((ioctl(0, TIOCCONS, 0)) == -1)
fprintf(stderr, "TIOCCONS failed\n");
}
- Matt Goheen
============================================================================
Hello
Put it in getconsole.c and compile.
Run getconsole on your terminal.
-----------------------------------
#include <sys/ioctl.h>
main()
{
if(ioctl(0,TIOCCONS)) printf("BAD ioctl()\n");
}
-----------------------------------
Regards,
Leon Koll
============================================================================
Many thanks to:
Pauline van Winsen (ups!pauline@fourx.Aus.Sun.COM)
Kevin Sheehan (kevin%ups.uucp@fourx.Aus.Sun.COM)
Pete Phillips (pete@smtl.demon.co.uk)
Raymond Ballisti (ballisti@ifh.ee.ethz.ch)
Anthony Worrall (Anthony.Worrall@Reading.ac.uk)
Mark S. Anderson (anderson@neon.mitre.org)
Matt Goheen (mat@wbst845e.xerox.com)
Thomas J Davis (davis@udecc.engr.udayton.edu)
Ralph Finch (rfinch@water.ca.gov)
Leon Koll (leon@orbot.co.il)
-- Khantipol Kasemsant sunoct!ktp@Singapore.Sun.COM Open Computing Technologies B.B.Building Suite#1802 Voice: (662) 260-7590 - 4 Asoke Rd., Bangkok 10110, THAILAND Fax: (662) 260-7595
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:27 CDT