[NCLUG] /var/log/message to console...
Michael Dwyer
mdwyer at sixthdimension.com
Wed Jun 13 10:01:29 MDT 2001
> Gary> On a different note, does anyone know if it's possible to define
> Gary> 'tail /var/adm/SYSLOG' (or your syslog location of choice) as
> Gary> the default program for a TTY? I seem to rememer that you could
> Gary> do it with SAF under Solaris, but haven't the slightest of where
> Gary> it start on Linux, other than maybe man tty.
>
> try using 'open'. ;)
> 'man open' for more info.
That returns the open(2) system call. If I search, I can find the Tcl
open command, but nothing in userland. Is this the program that allows
you to run a program on a specific tty? I think I heard about it once,
but it apparently doesn't come on my distro. Actually it doesn't appear
to come on /your/ distro either. :) Or at least someone didn't install
it.
I suppose you could add a line in you /etc/inittab like this:
lg:34:respawn:/usr/bin/tail -f /var/log/syslog >/dev/tty7
^ ^ ^ ^
| | | + Name of command to run.
| | + If it dies, start it again.
| + Which runlevels to work in. 3 is a text-mode level, 4 is X
| May be different for other runlevels.
+ Generally meaningless identifier.
I'm not sure the redirection would work without the context of a
shell... and you would still have to kill the tail process (and let Init
start a new one) every time the log rotator woke up. But it /might/
work...
Mind you, messing around in your inittab is kinda dangerous...
experience speaking. The line above is one I just crafted, but haven't
tested. Your mileage may vary. Tell me if it works. :)
More information about the NCLUG
mailing list