[oe] [meta-oe][PATCH 3/4] syslog-ng: Fix errant ulimit settings
Ben Shelton
ben.shelton at ni.com
Mon Jul 21 15:52:09 UTC 2014
From: Richard Tollerton <rich.tollerton at ni.com>
Having a "minimum" of 4096 fds is kind of silly on some (most?) targets.
Signed-off-by: Richard Tollerton <rich.tollerton at ni.com>
Signed-off-by: Ben Shelton <ben.shelton at ni.com>
---
.../recipes-support/syslog-ng/files/fd-limit.patch | 36 ++++++++++++++++++++++
.../recipes-support/syslog-ng/syslog-ng_3.2.5.bb | 1 +
2 files changed, 37 insertions(+)
create mode 100644 meta-oe/recipes-support/syslog-ng/files/fd-limit.patch
diff --git a/meta-oe/recipes-support/syslog-ng/files/fd-limit.patch b/meta-oe/recipes-support/syslog-ng/files/fd-limit.patch
new file mode 100644
index 0000000..6c48c28
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/files/fd-limit.patch
@@ -0,0 +1,36 @@
+diff --git ./lib/gprocess.c-orig ./lib/gprocess.c
+index 3729ecb..6abef20 100644
+--- ./lib/gprocess.c-orig
++++ ./lib/gprocess.c
+@@ -604,23 +604,6 @@ g_process_detach_tty(void)
+ }
+
+ /**
+- * g_process_change_limits:
+- *
+- * Set fd limit.
+- *
+- **/
+-static void
+-g_process_change_limits(void)
+-{
+- struct rlimit limit;
+-
+- limit.rlim_cur = limit.rlim_max = process_opts.fd_limit_min;
+-
+- if (setrlimit(RLIMIT_NOFILE, &limit) < 0)
+- g_process_message("Error setting file number limit; limit='%d'; error='%s'", process_opts.fd_limit_min, g_strerror(errno));
+-}
+-
+-/**
+ * g_process_detach_stdio:
+ *
+ * Use /dev/null as input/output/error. This function is idempotent, can be
+@@ -1253,7 +1236,6 @@ g_process_start(void)
+ pid_t pid;
+
+ g_process_detach_tty();
+- g_process_change_limits();
+ g_process_resolve_names();
+
+ if (process_opts.mode == G_PM_BACKGROUND)
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.5.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.5.bb
index 9f89740..bb65dfe 100644
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.5.bb
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.5.bb
@@ -4,6 +4,7 @@ PR = "${INC_PR}.1"
SRC_URI += " \
file://syslog-ng.conf \
file://initscript \
+ file://fd-limit.patch \
"
FILES_${PN} += "${libdir}/${BPN}/*"
--
2.0.2
More information about the Openembedded-devel
mailing list