[syslog-ng] Patch syslog-ng-3.2.4-systemd-acquired-fd.patch (see bug #742624)

Jose Pedro Oliveira jpo at fedoraproject.org
Mon Oct 10 16:34:52 UTC 2011


commit e33c2c06771ca063add3f2f340c1beb24dbf9269
Author: Jose Pedro Oliveira <jpo at di.uminho.pt>
Date:   Mon Oct 10 17:22:11 2011 +0100

    Patch syslog-ng-3.2.4-systemd-acquired-fd.patch (see bug #742624)

 syslog-ng-3.2.4-systemd-acquired-fd.patch |   29 +++++++++++++++++++++++++++++
 syslog-ng.spec                            |    7 ++++++-
 2 files changed, 35 insertions(+), 1 deletions(-)
---
diff --git a/syslog-ng-3.2.4-systemd-acquired-fd.patch b/syslog-ng-3.2.4-systemd-acquired-fd.patch
new file mode 100644
index 0000000..66adde4
--- /dev/null
+++ b/syslog-ng-3.2.4-systemd-acquired-fd.patch
@@ -0,0 +1,29 @@
+From: Balazs Scheidler <bazsi at balabit.hu>
+Date: Wed, 22 Jun 2011 10:50:53 +0000 (+0200)
+Subject: systemd: make sure the acquired fd is in non-blocking mode
+X-Git-Url: http://git.balabit.hu/?p=bazsi%2Fsyslog-ng-3.2.git;a=commitdiff_plain;h=2f214c4f87d944aa28d53e331a67b1fd88d9840f
+
+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>
+---
+
+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),
diff --git a/syslog-ng.spec b/syslog-ng.spec
index b05205d..e891bbd 100644
--- a/syslog-ng.spec
+++ b/syslog-ng.spec
@@ -5,7 +5,7 @@
 
 Name: syslog-ng
 Version: 3.2.4
-Release: 8%{?dist}
+Release: 9%{?dist}
 Summary: Next-generation syslog server
 
 Group: System Environment/Daemons
@@ -19,6 +19,7 @@ Source4: syslog-ng.logrotate
 
 Patch0: syslog-ng-3.2.4-disable-ssl-tests.patch
 Patch1: syslog-ng-3.2.4-chain-hostnames-processing.patch
+Patch2: syslog-ng-3.2.4-systemd-acquired-fd.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -83,6 +84,7 @@ developing applications that use %{name}.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 # fix perl path
 %{__sed} -i 's|^#!/usr/local/bin/perl|#!%{__perl}|' contrib/relogger.pl
@@ -269,6 +271,9 @@ fi
 
 
 %changelog
+* Mon Oct 10 2011 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.2.4-9
+- Patch syslog-ng-3.2.4-systemd-acquired-fd.patch (see bug #742624)
+
 * Mon Oct 10 2011 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.2.4-8
 - disable linux-caps support for the time being (see bug #718439)
 


More information about the scm-commits mailing list