Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jun 2000 10:23:34 +0200 (SAT)
From:      Reinier Bezuidenhout <rbezuide@oskar.dev.nanoteq.co.za>
To:        freebsd-hackers@freebsd.org
Subject:   3-Stable: Logging to syslog fails
Message-ID:  <200006080823.KAA06230@oskar.dev.nanoteq.co.za>

next in thread | raw e-mail | index | archive | help
Hi 

I have a system running a stable snap of 3.4 of round about May 31,
I have a program that does quite a bit of logging, and sometime the
following occurs:

The process would just stop (seems to block) - a bt in gdb showed
that it was stuck in open after the following sequence of calls

syslog -> vsyslog -> open

After having a look at the code it seemed that the process was unable
to connect to syslogd and then continued to open the console (I have a
console configured on a serial line 9600 baud) and it got stuck in that open.

When I connected to the console, the log message was displayed.

On further inspection I saw that during the write of log info to syslog,
messages would stop appearing in the logfile in /var/log and ONLY be
displayed in the console.  If nothing was connected to the console, it
would block and wait for ever.

Is this because of some buffer which is too small somewhere ?? that can
be changed ... or is this a bug ... or normal behaviour.  e.g. What causes
the program not to be able to connect to write the log info ???

the sequence it seems to follow in libc's syslog.c
in the function vsyslog
Version   1.18.2.1

/* Get connected, output the message to the local logger. */

<this fails>

/* 
 * If the send() failed, the odds are syslogd was restarted.
 * Make one (only) attempt to reconnect to /dev/log.
 */

<This seems to fail too - this is not after a log rote or anything like that>

/* 
 * Output the message to the console; don't worry about blocking,
 * if console blocks everything will.  Make sure the error reported
 * is the one from the syslogd failure.
 */

And now it gets stuck in here
<line 263 of syslog.c in libc/gen>

 if (LogStat & LOG_CONS &&
    (fd = open(_PATH_CONSOLE, O_WRONLY, 0)) >= 0) {




thanks

Reinier


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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