[PATCHES] CTDB logging rework

Martin Schwenke martin at meltin.net
Thu Oct 23 02:54:01 MDT 2014


On Fri, 17 Oct 2014 21:00:29 +1100, Martin Schwenke <martin at meltin.net>
wrote:

> On Fri, 17 Oct 2014 10:55:53 +0200, Volker Lendecke
> <Volker.Lendecke at SerNet.DE> wrote:
> 
> > On Fri, Oct 17, 2014 at 02:53:01PM +1100, Martin Schwenke wrote:
> > > This reworks much of the CTDB logging subsystem.  Main points are:
> > > 
> > > * Bug fix to put a newline back at the end of messages logged to file
> > >   (recent regression).
> > > 
> > > * Remove the separate CTDB log daemon.
> > > 
> > > * Add syslog via UDP logging, as per RFCs 5424 and RFC5426.
> > 
> > As talked about via chat, it would be great to also do
> > nonblocking sendmsg to /dev/log.
> 
> Yep.  I've had more of a think.  I'll simplify it to have just a "file"
> and a "syslog" backend.  Instead of specifying "syslog-udp", I'll make
> it "syslog:udp", so the difference can be handled in the setup function.
> Then I can trivially add "syslog:lossy" (or "syslog:nonblocking").
> 
> ... and then I'm getting out of the logging business...  ;-)

I'm calling this done.  New patches attached.  :-)

Things I've learned:

* RFC5424 is not supported on /dev/log.

* RFC3164 is the alternative and, although specified for the UDP port,
  is not properly supported on UDP on FreeBSD... and nowhere
  on /dev/log (or /var/run/log on FreeBSD).  The best compromise is to
  use a degenerate form of RFC3164, which drops the header (timestamp
  and hostname) completely.  This allows rsyslogd to generate hi-res
  timestamps when configured, and allows reasonable logging on UDP,
  though with hostname "localhost".

* rsyslogd supports different message formats on different sockets.
  Why would you do that?!?

* I don't want to look at logging code for a while!  :-)

Please review and push if OK.

These patches are in my ctdb-logging branch:

  http://git.samba.org/?p=martins/samba.git;a=shortlog;h=refs/heads/ctdb-logging

When we sort out the debug_extra thing in CTDB, the RFC3164 logging
to /dev/log and UDP can probably go into debug.[ch] pretty easily.  The
UDP RFC5424 logging could go there too if setup_logging() is extended to
take a hostname... but later... much later...  :-)

peace & happiness,
martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba.patches
Type: application/octet-stream
Size: 99584 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141023/46803ea1/attachment-0001.obj>


More information about the samba-technical mailing list