From owner-freebsd-questions Thu Dec 30 12:30:52 1999 Delivered-To: freebsd-questions@freebsd.org Received: from dorifer.heim3.tu-clausthal.de (dorifer.heim3.tu-clausthal.de [139.174.243.252]) by hub.freebsd.org (Postfix) with ESMTP id 135A01541E for ; Thu, 30 Dec 1999 12:30:47 -0800 (PST) (envelope-from olli@dorifer.heim3.tu-clausthal.de) Received: (from olli@localhost) by dorifer.heim3.tu-clausthal.de (8.8.8/8.8.8) id VAA18011 for freebsd-questions@FreeBSD.ORG; Thu, 30 Dec 1999 21:30:45 +0100 (CET) (envelope-from olli) Date: Thu, 30 Dec 1999 21:30:45 +0100 (CET) From: Oliver Fromme Message-Id: <199912302030.VAA18011@dorifer.heim3.tu-clausthal.de> To: freebsd-questions@FreeBSD.ORG Subject: Re: /etc/ttys, dnetc, and freebsd :-) (Was: Re: kill -HUP 1) Organization: Administration TU Clausthal Reply-To: freebsd-questions@FreeBSD.ORG MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: TIN [version 1.2 RZTUC(3) PL2] Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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