niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
A sort of plan for consoles in FreeBSD
Post new topic   Reply to topic Page 1 of 2 [28 Posts] View previous topic :: View next topic
Goto page:  1, 2 Next
Author Message
Peter Wemm
*nix forums Guru Wannabe


Joined: 11 Apr 2002
Posts: 113

PostPosted: Mon Jun 12, 2006 10:07 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

On Sunday 28 May 2006 01:05, Poul-Henning Kamp wrote:
Quote:
In message <20060528.011518.1306332021.imp@bsdimp.com>, "M. Warner
Losh" writes

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?

Typically programs in distress.

FWIW. The syslog(3) library call will open /dev/console if it cannot
connect to the syslog socket and LOG_CONS is set.

--
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Julian Elischer
*nix forums Guru Wannabe


Joined: 20 Mar 2002
Posts: 279

PostPosted: Tue May 30, 2006 6:23 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

M. Warner Losh wrote:

Quote:
In message: <86pshx85tu.fsf@xps.des.no
des@des.no (Dag-Erling Smørgrav) writes:
: "M. Warner Losh" <imp@bsdimp.com> writes:
: > There's no way to 'connect to syslogd and subscribe to messages' in
: > the current syslogd.
:
: tail -F /var/log/messages



in -currnet you can listen on any UDP port and have syslog send you stuff.

Quote:
That doesn't give you what I described. What that does is give you
the messages that syslogd writes to /var/log/messages. This is a
subset of the messages sent to syslogd, and doesn't have the severity
levels, facilities, etc associated with them. There's no way for one
to connect to syslogd and dynamically filter the records that are
displayed. While adding such a facility wouldn't be that hard, it
does not exist today.

Warner



_______________________________________________

freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Poul-Henning Kamp
*nix forums Guru


Joined: 21 Mar 2002
Posts: 436

PostPosted: Tue May 30, 2006 6:03 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

In message <20060530135814.A70588@grasshopper.cs.duke.edu>, Andrew Gallatin wri
tes:
Quote:
Poul-Henning Kamp [phk@phk.freebsd.dk] wrote:
I would like to redefine the semantics of "/dev/console" as follows:

if any console-consumers like xconsole(Cool 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)

If there is nobody logged in, where do kernel messages from device
drivers, and panic messages (with helpful things like KDB_TRACE) wind
up?

These go to the #2 console just like the bootup messages etc.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Andrew Gallatin
*nix forums addict


Joined: 18 Jul 2002
Posts: 52

PostPosted: Tue May 30, 2006 5:58 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

Poul-Henning Kamp [phk@phk.freebsd.dk] wrote:
Quote:
I would like to redefine the semantics of "/dev/console" as follows:

if any console-consumers like xconsole(Cool 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)

If there is nobody logged in, where do kernel messages from device
drivers, and panic messages (with helpful things like KDB_TRACE) wind
up? I hope the answer is not "nowhere". I have debugged many
problems after they happened by looking at serial console logs,
and I would hate to loose this.

Drew
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
M. Warner Losh
*nix forums Guru


Joined: 22 Mar 2002
Posts: 365

PostPosted: Mon May 29, 2006 5:29 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

In message: <86pshx85tu.fsf@xps.des.no>
des@des.no (Dag-Erling Smørgrav) writes:
: "M. Warner Losh" <imp@bsdimp.com> writes:
: > There's no way to 'connect to syslogd and subscribe to messages' in
: > the current syslogd.
:
: tail -F /var/log/messages

That doesn't give you what I described. What that does is give you
the messages that syslogd writes to /var/log/messages. This is a
subset of the messages sent to syslogd, and doesn't have the severity
levels, facilities, etc associated with them. There's no way for one
to connect to syslogd and dynamically filter the records that are
displayed. While adding such a facility wouldn't be that hard, it
does not exist today.

Warner

_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Poul-Henning Kamp
*nix forums Guru


Joined: 21 Mar 2002
Posts: 436

PostPosted: Mon May 29, 2006 10:49 am    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

In message <86pshx85tu.fsf@xps.des.no>, Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=
writes:
Quote:
"M. Warner Losh" <imp@bsdimp.com> writes:
There's no way to 'connect to syslogd and subscribe to messages' in
the current syslogd.

tail -F /var/log/messages

Yes, that is sort of a substitute, but not quite...

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Dag-Erling Smørgrav
*nix forums Guru Wannabe


Joined: 16 Mar 2003
Posts: 186

PostPosted: Mon May 29, 2006 10:48 am    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

"M. Warner Losh" <imp@bsdimp.com> writes:
Quote:
There's no way to 'connect to syslogd and subscribe to messages' in
the current syslogd.

tail -F /var/log/messages

DES
--
Dag-Erling Smørgrav - des@des.no
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Doug Barton
*nix forums addict


Joined: 24 Apr 2002
Posts: 91

PostPosted: Sun May 28, 2006 6:08 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

Poul-Henning Kamp wrote:
Quote:
In message <4478F767.5090403@FreeBSD.org>, Doug Barton writes:

At first glance I don't see anything wrong with that logic. My one request
is that you add a branch that says, "if legacy behavior is requested by
some configuration method>, add it to the mix."

Legacy behaviour is exactly what we need to avoid to get the
device locking sorted out, so this would be rather poisonous
to the entire effort.

Just to be clear, I'm not saying that the mechanism for making it happen has
to be the same, just that having the same end result would be very useful.

Doug

--

This .signature sanitized for your protection

_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Poul-Henning Kamp
*nix forums Guru


Joined: 21 Mar 2002
Posts: 436

PostPosted: Sun May 28, 2006 5:51 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

In message <20060528.113724.1655407378.imp@bsdimp.com>, "M. Warner Losh" writes
:

Quote:
Why we can't do as I suggested earlier and just make /dev/console a
pseudo-pipe that is fed from #2 and #4 and that has a well documented
'other end interface' for things like xconsole. that would simulate
the historical usage of /dev/console well.

We probably _can_ do that, but it would be easier to teach syslogd
about accept connections from processes interested in subscribing
to events.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
M. Warner Losh
*nix forums Guru


Joined: 22 Mar 2002
Posts: 365

PostPosted: Sun May 28, 2006 5:37 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

In message: <1471.1148836757@critter.freebsd.dk>
"Poul-Henning Kamp" <phk@phk.freebsd.dk> writes:
: In message <4479D804.1060106@elischer.org>, Julian Elischer writes:
: >M. Warner Losh wrote:
: >
: >>In message: <4479C171.4050403@elischer.org>
: >> Julian Elischer <julian@elischer.org> writes:
: >>: killing XConsole is not a small matter. people have that when they are
: >>: specifically looking for that information
: >>
: >>Recall that this is only for programs that open /dev/console directly
: >>and write to it, like syslogd.
: >
: >the description makes it sound like xconsole would not be able to show
: >kernel error messages.
:
: xconsole is a hack anyway.
:
: the correct way would be to have way to connect to syslogd and subscribe
: to messages.

There's no way to 'connect to syslogd and subscribe to messages' in
the current syslogd. In today's world order, the best that it can do
is to open a pty, and then hack syslogd.conf to send messages to that
pty and then log the results. This takes quiet a bit of code, and
there's a number of tricky edge cases to make it work. At least there
were back when I created a combination xconsole + syslog display
program. And I still didn't have the ability to filter on message
time except in real time (since syslogd doesn't print message type).
I also had to have two PTYs open (one for syslog messages and one for
console messages). If you are going to go down this route, lots of
work needs to happen to both xconsole and syslogd (and all other
xconsole-like programs).

Not saying that it can't be done, but there's a big hunk of work there
before people would be happy.

Why we can't do as I suggested earlier and just make /dev/console a
pseudo-pipe that is fed from #2 and #4 and that has a well documented
'other end interface' for things like xconsole. that would simulate
the historical usage of /dev/console well.

Warner
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Poul-Henning Kamp
*nix forums Guru


Joined: 21 Mar 2002
Posts: 436

PostPosted: Sun May 28, 2006 5:19 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

In message <4479D804.1060106@elischer.org>, Julian Elischer writes:
Quote:
M. Warner Losh wrote:

In message: <4479C171.4050403@elischer.org
Julian Elischer <julian@elischer.org> writes:
: killing XConsole is not a small matter. people have that when they are
: specifically looking for that information

Recall that this is only for programs that open /dev/console directly
and write to it, like syslogd.

the description makes it sound like xconsole would not be able to show
kernel error messages.

xconsole is a hack anyway.

the correct way would be to have way to connect to syslogd and subscribe
to messages.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Julian Elischer
*nix forums Guru Wannabe


Joined: 20 Mar 2002
Posts: 279

PostPosted: Sun May 28, 2006 5:04 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

M. Warner Losh wrote:

Quote:
In message: <4479C171.4050403@elischer.org
Julian Elischer <julian@elischer.org> writes:
: killing XConsole is not a small matter. people have that when they are
: specifically looking for that information

Recall that this is only for programs that open /dev/console directly
and write to it, like syslogd.




the description makes it sound like xconsole would not be able to show
kernel error messages.

Quote:
Warner


_______________________________________________

freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
M. Warner Losh
*nix forums Guru


Joined: 22 Mar 2002
Posts: 365

PostPosted: Sun May 28, 2006 4:46 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

In message: <4479C171.4050403@elischer.org>
Julian Elischer <julian@elischer.org> writes:
: killing XConsole is not a small matter. people have that when they are
: specifically looking for that information

Recall that this is only for programs that open /dev/console directly
and write to it, like syslogd.

Warner
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Julian Elischer
*nix forums Guru Wannabe


Joined: 20 Mar 2002
Posts: 279

PostPosted: Sun May 28, 2006 3:27 pm    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

Poul-Henning Kamp wrote:

Quote:
In message <20060528.011518.1306332021.imp@bsdimp.com>, "M. Warner Losh" writes
:


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?



Typically programs in distress.



If so, why not make /dev/console a pipe that syslogd listens to?



That is the option which I personally favour.

It kills xconsole(1) like applications, and I suspect that would
result in whinage, but if we are willing to do that, it is by
far the simplest and most sensible solution.


killing XConsole is not a small matter. people have that when they are

specifically looking for that information

Quote:


: I would like to redefine the semantics of "/dev/console" as follows:
: if any console-consumers like xconsole(Cool 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.



It is only #4.



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?



As I said in the other email, /dev/tty and stderr is not quite the
same thing. /dev/tty has more of the semantics that /dev/console
used to have (ie: flash it before their eyes).



_______________________________________________

freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Poul-Henning Kamp
*nix forums Guru


Joined: 21 Mar 2002
Posts: 436

PostPosted: Sun May 28, 2006 8:07 am    Post subject: Re: A sort of plan for consoles in FreeBSD Reply with quote

In message <4478F767.5090403@FreeBSD.org>, Doug Barton writes:

Quote:
At first glance I don't see anything wrong with that logic. My one request
is that you add a branch that says, "if legacy behavior is requested by
some configuration method>, add it to the mix."

Legacy behaviour is exactly what we need to avoid to get the
device locking sorted out, so this would be rather poisonous
to the entire effort.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 2 [28 Posts] Goto page:  1, 2 Next
View previous topic :: View next topic
The time now is Thu Dec 04, 2008 1:16 am | All times are GMT
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Berkeley db XML & FreeBSD mo Berkeley DB 0 Thu Jul 20, 2006 9:15 pm
No new posts Squid 2.6 WCCPv2 and FreeBSD Carlos Filipe Squid 0 Thu Jul 20, 2006 7:48 pm
No new posts freebsd with apache, php and mysql Yves Savoie FreeBSD 5 Wed Jul 19, 2006 11:39 pm
No new posts Is there any standard way to sort a disk file? Peter Olcott C++ 5 Wed Jul 19, 2006 4:42 pm
No new posts problems with drac for exim on freebsd Sebastian Inacker Exim 2 Wed Jul 19, 2006 3:36 pm

Israel Perry | Mortgages | Loan Consolidation | Credit Check | Gas Suppliers
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2765s ][ Queries: 16 (0.1372s) ][ GZIP on - Debug on ]