klogd stops logging after some time

Bug #14283 reported by Sami Haahtinen
6
Affects Status Importance Assigned to Milestone
sysklogd (Ubuntu)
Fix Released
Critical
Martin Pitt

Bug Description

It appears that klogd stops logging messages to syslog after some time.
Restarting klogd resumes logging.

With a quick peek, dd and klogd both are running, so it doesn't appear that
anything is dying or anything.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Do you still see messages in dmesg?

Revision history for this message
Matt Zimmerman (mdz) wrote :

I am seeing this problem on one of my systems as well. I see at least two problems:

- dd is buffering at a block size of 512 bytes, so no messages are written to
the fifo until 512 bytes of messages are received
- If I cause enough kernel messages to fill the buffer, klogd fails to write
them to the syslog socket:

Process 8580 attached - interrupt to quit
read(0, "rom: open failed.\n<6>cdrom: open"..., 4095) = 512
time([1111342305]) = 1111342305
write(3, "<6>Mar 20 10:11:45 kernel: cdrom"..., 47) = -1 ENOTCONN (Transport
endpoint is not connected)

I see that syslogd has been restarted by cron.daily, but klogd has been running
for much longer:

klog 8580 0.0 0.0 2408 1444 ? Ss Feb25 0:00 /sbin/klogd -P
/var/run/klogd/kmsg
syslog 6348 0.0 0.0 1740 728 ? SNs 07:38 0:00 /sbin/syslogd
-u syslog -r

Perhaps klogd needs to reconnect to the syslog socket after syslogd has been
restarted?

Restarting klogd is enough to resolve the second problem. The first problem
must be fixed in the dd invocation.

Revision history for this message
Sami Haahtinen (ressu) wrote :

As i forgot to mention:

Yes, the messages show up in dmesg.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #2)
> I am seeing this problem on one of my systems as well. I see at least two
problems:
>
> - dd is buffering at a block size of 512 bytes, so no messages are written to
> the fifo until 512 bytes of messages are received

Right, this should be fixed by using a block size of 1.

> Perhaps klogd needs to reconnect to the syslog socket after syslogd has been
> restarted?

Indeed, this affects the non-derooted klogd as well and is #284877 in Debian.

Revision history for this message
Martin Pitt (pitti) wrote :

Changes:
 sysklogd (1.4.1-16ubuntu5) hoary; urgency=low
 .
   * debian/rc.klogd: Use buffer size 1 instead of default 512 for the dd
     process to avoid message lag.
   * syslog.c, vsyslog(): Attempt to reconnect to the syslog daemon if writing
     to it fails (because it was restarted). (Ubuntu #7945, Debian #284877)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.