From: "Miquel van Smoorenburg" <miquels@cistron.nl>
To: linux-kernel@vger.kernel.org
Subject: Re: [patch] printk from userspace
Date: Wed, 14 Aug 2002 07:59:01 +0000 (UTC) [thread overview]
Message-ID: <ajd2k5$h8l$1@ncc1701.cistron.net> (raw)
In-Reply-To: Pine.LNX.4.44.0208132123500.1208-100000@home.transmeta.com
In article <Pine.LNX.4.44.0208132123500.1208-100000@home.transmeta.com>,
Linus Torvalds <torvalds@transmeta.com> wrote:
>That said, I like the notion. I've always hated the fact that all the
>boot-time messages get lost, simply because syslogd hadn't started, and
>as a result things like fsck ran without any sign afterwards. The kernel
>log approach saves it all in one place.
I have a bootlogd that does a TIOCCONS on /dev/console, so
that it can capture all messages written to /dev/console.
It buffers the messages in-memory, until it is able to open
a logfile in /var/log/ at which point it writes the buffered
data to the logfile, and starts logging to that file.
The only problem is that TIOCCONS is a redirect, so there's no
output to the console anymore. Ofcourse that can be solved by
letting bootlogd open("/dev/realconsole") and sending a copy
to it, but there is no way to ask the kernel to which _real_
device /dev/console is connected.
I submitted a TIOCGDEV ioctl patch a few times during 2.2 development
but it was never integrated, alas.
So this is all solveable in userspace. No need to buffer
messages in non-swappable memory in the the kernel.
Simply add TIOCGDEV or add a flags to the TIOCCONS ioctl that
means 'copy instead of redirect'. Both are useful .. Or, hmm,
interesting, add some code so that if you write to the master
side of the pty pair to which the console is redirected, the
output ends up on the real console. That has a nice symmetric
feel to it.
Sample code is in sysvinit since 2.79 or 2.80, sysvinit-2.xx/src/bootlogd.c
Mike.
next prev parent reply other threads:[~2002-08-14 7:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-14 3:18 [patch] printk from userspace Andrew Morton
2002-08-14 3:58 ` Benjamin LaHaise
2002-08-14 4:00 ` H. Peter Anvin
2002-08-14 4:05 ` Benjamin LaHaise
2002-08-14 4:10 ` Alexander Viro
2002-08-14 4:11 ` Andrew Morton
2002-08-14 4:07 ` Benjamin LaHaise
2002-08-14 4:20 ` Alexander Viro
2002-08-14 4:26 ` Linus Torvalds
2002-08-14 4:35 ` Benjamin LaHaise
2002-08-14 4:42 ` H. Peter Anvin
2002-08-14 4:44 ` Linus Torvalds
2002-08-14 4:44 ` H. Peter Anvin
2002-08-14 4:48 ` Benjamin LaHaise
2002-08-14 4:58 ` Andrew Morton
2002-08-14 5:32 ` H. Peter Anvin
2002-08-19 11:28 ` Daniel Phillips
2002-08-14 7:59 ` Miquel van Smoorenburg [this message]
2002-08-14 16:12 ` serial console (was Re: [patch] printk from userspace) Arkadiusz Miskiewicz
2002-08-15 12:43 ` Miquel van Smoorenburg
2002-08-14 4:33 ` [patch] printk from userspace H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='ajd2k5$h8l$1@ncc1701.cistron.net' \
--to=miquels@cistron.nl \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox