A sort of plan for consoles in FreeBSD
M. Warner Losh
imp at bsdimp.com
Sun May 28 00:32:48 PDT 2006
In message: <16029.1148764704 at critter.freebsd.dk>
Poul-Henning Kamp <phk at 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
More information about the freebsd-arch
mailing list