Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Dec 1999 21:30:45 +0100 (CET)
From:      Oliver Fromme <olli@dorifer.heim3.tu-clausthal.de>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: /etc/ttys, dnetc, and freebsd :-) (Was: Re: kill -HUP 1)
Message-ID:  <199912302030.VAA18011@dorifer.heim3.tu-clausthal.de>

next in thread | raw e-mail | index | archive | help
Alexey N. Dokuchaev wrote in list.freebsd-questions:
 > ttyva	none
 > ttyvb	none
 > 
 > Well, I should expect that pressing Alt-F12 will bring up my logs, and
 > Alt-F11 will show me black screen.  Hell no!  I won't be able to switch to
 > that concole (it will beep).

That's because /dev/ttyva is not open.  You can only switch to
it when some process has opened it (getty, syslogd or whatever).

Each time a process opens a virtual terminal, a counter in the
device code is inremented by one.  Likewise, it is decremented
when the device is closed.  When that counter is 0, syscons
assumes that there is nothing on that virtual terminal, and it
refuses to switch to it (causing a beep).

 > The reason why I need ttyva clean (not getty) is that I wan't dnetc CSC
 > client put it's log there, so I don't need to tail -f them (hence to be
 > login all the time).
 > 
 > What fascinates me, that if I being root do:
 > 
 > cat /etc/ttyva
 > 
 > I will be able to switch to ttyva with Alt-F11, and all logs are there!!!!

Yes, because cat opens the device, obviously.

 > But as soon as I press ^D, it's gone!  No more logs!

When cat exits, the device is closed again.

I don't know what "dnetc CSC" is, but obviously it doesn't keep
the device open which it is logging to (otherwise you would be
able to switch to your 11th terminal all the time, just like
the 12th which contains your syslog output).  It probably opens
the device for each line to write, and then closes it immedia-
tely again.  Don't ask me why...  The "normal UNIX behaviour"
is to keep the log file/device open all the time, and only
close and re-open it upon receipt of a HUP or similar signal
(e.g. for logfile rotation).

A workaround (an ugly one) would be to have a dummy process
hanging around that keeps the device open all the time, like
your "cat" did above.  A better solution would be to modify
"dnetc CSC" to do the right thing.

Regards
   Oliver

-- 
Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany
(Info: finger userinfo:olli@dorifer.heim3.tu-clausthal.de)

"In jedem Stück Kohle wartet ein Diamant auf seine Geburt"
                                         (Terry Pratchett)


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912302030.VAA18011>