[buildd-tools-devel] buildd logging fix

Roger Leigh rleigh at codelibre.net
Sun Jan 10 18:16:16 UTC 2010


Hi Marc,

I've written a proposed patch to eliminate the logging issues
for buildd.  It's on the buildd-plain-log branch of
git://git.debian.org/users/rleigh/sbuild.git
I've also attached the patch to this mail.

The patch eliminates the logger co-process in favour of opening the
logfile with O_CREAT|O_APPEND|O_WRONLY.  This should not result in
garbled logs unless a single log line exceeds the limit for a single
atomic block write, and even then it's unlikely.  The existing
logger had an even lower limit (the size of a pipe buffer, which is
typically 4 KiB).

The log open/close/reopen are now in the buildd base class for use by
all buildd modules.  The log is opened automatically when the object
is created.  Closing is not currently automatic but TBH that's not
important since an automatic close by the system is also OK, though I
have included an explicit close for most programs.  reopen is now
implemented in terms of open and close, and is written to cope as best
as possible with a failure to close.

All programs opening daemon.log (buildd, buildd-mail, buildd-uploader,
buildd-watcher) need testing.  Additionally, buildd needs testing with
SIGHUP to check log reopening (should show up in the logfile).  Also
try mv of the logfile and then a SIGHUP to check log rotation; it
should recreate a new logfile and write a reopen message to the new
file.

If this works OK for you, feel free to merge it onto the buildd and
master branches.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: buildd-plain-log.patch
Type: text/x-diff
Size: 7860 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20100110/925db148/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20100110/925db148/attachment.pgp>


More information about the Buildd-tools-devel mailing list