Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 May 2006 01:15:18 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        phk@phk.freebsd.dk
Cc:        arch@freebsd.org
Subject:   Re: A sort of plan for consoles in FreeBSD
Message-ID:  <20060528.011518.1306332021.imp@bsdimp.com>
In-Reply-To: <16029.1148764704@critter.freebsd.dk>
References:  <16029.1148764704@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <16029.1148764704@critter.freebsd.dk>
            Poul-Henning Kamp <phk@phk.freebsd.dk> writes:
: 4. The /dev/console device in multi-user mode.
:     Emergency output device for critical messages.

Who is generating these messages?  Are these for the programs that
open /dev/console and spit out 'oh shit' messages?  If so, why not
make /dev/console a pipe that syslogd listens to?  #3 can be solved by
using a different name.  Hmmm, I guess it would have to be a special
kind of pipe where all writers go to the same readers since you'd
want the output from #2 to go down this pipe as well.

: I would like to redefine the semantics of "/dev/console" as follows:
: 	if any console-consumers like xconsole(8) are active
: 		send output to all console-consumers.
: 	else if a controlling terminal is available
: 		send output to controlling terminal (that is /dev/tty)
: 	else
: 		send output to syslogd, as if generated by printf(9).
: 		(but do not actually output to low-level console)

Assuming that this is for #4 /dev/console, that's fine.  If you are
talking about #2 or #3, then we have problems.  The problem that I
have with it being just /dev/tty is that the program opened
/dev/console to tell the world about it, rather than just using
fprintf(stderr,).  What does that gain you?  Things like syslog
already log to stderr as well as /dev/console (when told to do both).
This would remove most syslog messages from the logs if they were from
programs with controlling ttys (all nondaemons).

: If xconsole(8) or similar programs are run, or if syslogd(8) is
: told to record all console output, they will get what they expect.
: Alternatively, we try to send the message to the relevant user and
: if that fails (for daemons) we log it in syslog.

I'm not sure that I see the point of sending it to the actual user.
Things like syslog already have an option to print to stderr as well
as /dev/console.  I think that muddies the waters.

: This also involves number #3 from the list because today /sbin/init
: opens /dev/console for single user mode and /etc/rc.  But /sbin/init
: can use any tty device so adding the necessary code to make the
: low-level console communicate the relevant tty name to /sbin/init,
: possibly making it overridable from the loader with a hint, will
: take care of that.

Indeed, it would.

: Comments, ideas, suggestions etc welcome

Warner



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