[arch-commits] Commit in syslog-ng/trunk (PKGBUILD non-blocking-systemd-fds.patch)

Dave Reisner dreisner at archlinux.org
Tue Jun 28 13:40:43 UTC 2011


    Date: Tuesday, June 28, 2011 @ 09:40:42
  Author: dreisner
Revision: 129498

upgpkg: syslog-ng 3.2.4-2
-m

Added:
  syslog-ng/trunk/non-blocking-systemd-fds.patch
Modified:
  syslog-ng/trunk/PKGBUILD

--------------------------------+
 PKGBUILD                       |   23 ++++++++++++++++++-----
 non-blocking-systemd-fds.patch |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 5 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-06-28 13:33:04 UTC (rev 129497)
+++ PKGBUILD	2011-06-28 13:40:42 UTC (rev 129498)
@@ -1,10 +1,11 @@
 # $Id$
+# Maintainer: Dave Reisner <dreisner at archlinux.org>
 # Maintainer: Eric Bélanger <eric at archlinux.org>
 # Maintainer: Aaron Griffin <aaron at archlinux.org>
 
 pkgname=syslog-ng
 pkgver=3.2.4
-pkgrel=1
+pkgrel=2
 pkgdesc="Next-generation syslogd with advanced networking and filtering capabilities"
 arch=('i686' 'x86_64')
 license=('GPL2')
@@ -17,14 +18,17 @@
 options=('!libtool')
 backup=('etc/syslog-ng/modules.conf' 'etc/syslog-ng/scl.conf' \
         'etc/syslog-ng/syslog-ng.conf' 'etc/logrotate.d/syslog-ng')
-source=(http://www.balabit.com/downloads/files/syslog-ng/sources/${pkgver}/source/${pkgname}_${pkgver}.tar.gz \
+source=(http://www.balabit.com/downloads/files/syslog-ng/sources/${pkgver}/source/${pkgname}_${pkgver}.tar.gz
+        non-blocking-systemd-fds.patch
         syslog-ng.conf syslog-ng.logrotate syslog-ng.rc cap_syslog.patch)
 md5sums=('5995f7dad0053a478b60a63f6f754203'
+         '25e43afe51eb2223c25168e3c3e7aaf6'
          '344dddfff946300f5576b13a7e8ea19f'
          '735636090be4582885974542d2a75855'
          '8b4441343d859c2f01c2cf799a7e6f98'
          '46e5dcff71f820d497898331a3f608fe')
 sha1sums=('ff732f7223bd2bd0424d4b9028b523cf62133af1'
+          '73b83deae9a8b945dfb13adf331e6bf6f119b83e'
           'b9eb8c61f7cccda543fc5c97fe1d40a8d15e713f'
           'ac997b25d7d8e69e66782d3771a0e12aff55ae7f'
           '4481819762fd1b6f25903016a8878e63c0058fcb'
@@ -32,13 +36,21 @@
 
 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
-# fix #22555 for kernels >=2.6.38
-  patch -p1 -i ../cap_syslog.patch 
+
+  # fix #22555 for kernels >=2.6.38
+  patch -p1 -i ../cap_syslog.patch
+
+  # fix systemd blocking FD bug
+  # https://bugzilla.balabit.com/show_bug.cgi?id=125
+  patch -Np1 < "$srcdir/non-blocking-systemd-fds.patch"
+
   ./configure --prefix=/usr --sysconfdir=/etc/syslog-ng \
     --libexecdir=/usr/lib --localstatedir=/var/lib/syslog-ng \
     --enable-tcp-wrapper \
     --with-pidfile-dir=/var/run \
-    --disable-spoof-source
+    --disable-spoof-source \
+    --enable-systemd
+
   make
 }
 
@@ -49,4 +61,5 @@
   install -Dm644 "${srcdir}/syslog-ng.conf" "${pkgdir}/etc/syslog-ng/syslog-ng.conf"
   install -Dm644 "${srcdir}/syslog-ng.logrotate" "${pkgdir}/etc/logrotate.d/syslog-ng"
   install -Dm755 "${srcdir}/syslog-ng.rc" "${pkgdir}/etc/rc.d/syslog-ng"
+  install -Dm644 "doc/examples/syslog-ng.service" "$pkgdir/lib/systemd/system/syslog-ng.service"
 }

Added: non-blocking-systemd-fds.patch
===================================================================
--- non-blocking-systemd-fds.patch	                        (rev 0)
+++ non-blocking-systemd-fds.patch	2011-06-28 13:40:42 UTC (rev 129498)
@@ -0,0 +1,32 @@
+From 2f214c4f87d944aa28d53e331a67b1fd88d9840f Mon Sep 17 00:00:00 2001
+From: Balazs Scheidler <bazsi at balabit.hu>
+Date: Wed, 22 Jun 2011 12:50:53 +0200
+Subject: [PATCH] systemd: make sure the acquired fd is in non-blocking mode
+
+The fd acquired from systemd is in blocking mode, and syslog-ng
+didn't explicitly set it to non-blocking, causing syslog-ng
+to stall. This patch changes that, explicitly enables
+O_NONBLOCK and O_CLOEXEC on systemd acquired fds.
+
+Reported-By: Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
+Signed-off-by: Balazs Scheidler <bazsi at balabit.hu>
+---
+ modules/afsocket/afunix.c |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/modules/afsocket/afunix.c b/modules/afsocket/afunix.c
+index cd9c205..9a4e37b 100644
+--- a/modules/afsocket/afunix.c
++++ b/modules/afsocket/afunix.c
+@@ -108,6 +108,8 @@ afunix_sd_acquire_socket(AFSocketSourceDriver *s, gint *result_fd)
+ 
+   if (*result_fd != -1)
+     {
++      g_fd_set_nonblock(*result_fd, TRUE);
++      g_fd_set_cloexec(*result_fd, TRUE);
+       msg_verbose("Acquired systemd socket",
+ 		  evt_tag_str("filename", self->filename),
+ 		  evt_tag_int("systemd-sock-fd", *result_fd),
+-- 
+1.7.5.4
+




More information about the arch-commits mailing list