summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrej Valek <andrej.valek@siemens.com>2018-06-14 09:37:01 +0200
committerKhem Raj <raj.khem@gmail.com>2018-06-14 20:25:16 -0700
commit0ce7d3d0413559d9a41027273cb4bccaefd6ba73 (patch)
tree2ea7b055fb03ff1d4385bcf57b1eef3d7bc61821
parent377497705500c77dc1b8093f6667952d2402054e (diff)
downloadmeta-openembedded-0ce7d3d0413559d9a41027273cb4bccaefd6ba73.tar.gz
syslog-ng: update to 3.15.1
- Refresh and remove obsolete patches - Fix PAGESIZE variable conflicting - PAGESIZE is a define in some libc libraries - Implement SystemD service files handling - splitted service into default - Remove dependency to eventlog - external libevtlog library linking was removed - Version 3.15.1 supports OpenSSL 1.1 Signed-off-by: Andrej Valek <andrej.valek@siemens.com> Signed-off-by: Marko Pater <peter.marko@siemens.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch29
-rw-r--r--meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch16
-rw-r--r--meta-oe/recipes-support/syslog-ng/files/rename-PAGESIZE-variables-to-pagesize.patch72
-rw-r--r--meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf2
-rw-r--r--meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch38
-rw-r--r--meta-oe/recipes-support/syslog-ng/syslog-ng.inc21
-rw-r--r--meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb11
-rw-r--r--meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb11
8 files changed, 131 insertions, 69 deletions
diff --git a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch b/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
deleted file mode 100644
index 5d481f232e..0000000000
--- a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1Fix the memory leak problem when HAVE_ENVIRON is defined
2
3Upstream-Status: Pending
4
5Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
6---
7Index: syslog-ng-3.8.1/lib/gprocess.c
8===================================================================
9--- syslog-ng-3.8.1.orig/lib/gprocess.c
10+++ syslog-ng-3.8.1/lib/gprocess.c
11@@ -1432,6 +1432,18 @@ g_process_startup_ok(void)
12 void
13 g_process_finish(void)
14 {
15+#ifdef HAVE_ENVIRON
16+ int i = 0;
17+
18+ while (environ[i]) {
19+ g_free(environ[i]);
20+ ++i;
21+ }
22+ if (environ)
23+ g_free(environ);
24+ if (process_opts.argv_orig)
25+ free(process_opts.argv_orig);
26+#endif
27 g_process_remove_pidfile();
28 }
29
diff --git a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
index c172e4e747..4f8a3d0775 100644
--- a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
+++ b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
@@ -10,21 +10,21 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
10 configure.ac | 17 +++++++++++------ 10 configure.ac | 17 +++++++++++------
11 1 file changed, 11 insertions(+), 6 deletions(-) 11 1 file changed, 11 insertions(+), 6 deletions(-)
12 12
13Index: syslog-ng-3.8.1/configure.ac 13Index: syslog-ng-3.15.1/configure.ac
14=================================================================== 14===================================================================
15--- syslog-ng-3.8.1.orig/configure.ac 15--- syslog-ng-3.15.1.orig/configure.ac
16+++ syslog-ng-3.8.1/configure.ac 16+++ syslog-ng-3.15.1/configure.ac
17@@ -147,6 +147,9 @@ AC_ARG_ENABLE(gprof, 17@@ -190,6 +190,9 @@ AC_ARG_ENABLE(gprof,
18 AC_ARG_ENABLE(memtrace, 18 AC_ARG_ENABLE(memtrace,
19 [ --enable-memtrace Enable alternative leak debugging code.]) 19 [ --enable-memtrace Enable alternative leak debugging code.])
20 20
21+AC_ARG_ENABLE(thread-tls, 21+AC_ARG_ENABLE(thread-tls,
22+ [ --enable-thread-tls Enable Thread Transport Layer Security support.],,enable_thread_tls="no") 22+ [ --enable-thread-tls Enable Thread Local Storage support.],,enable_thread_tls="no")
23+ 23+
24 AC_ARG_ENABLE(dynamic-linking, 24 AC_ARG_ENABLE(dynamic-linking,
25 [ --enable-dynamic-linking Link everything dynamically.],,enable_dynamic_linking="auto") 25 [ --enable-dynamic-linking Link everything dynamically.],,enable_dynamic_linking="auto")
26 26
27@@ -486,12 +489,14 @@ dnl ************************************ 27@@ -591,12 +594,14 @@ dnl ***************************************************************************
28 dnl Is the __thread keyword available? 28 dnl Is the __thread keyword available?
29 dnl *************************************************************************** 29 dnl ***************************************************************************
30 30
@@ -33,14 +33,14 @@ Index: syslog-ng-3.8.1/configure.ac
33-__thread int a; 33-__thread int a;
34-]], 34-]],
35-[a=0;])], 35-[a=0;])],
36-[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")]) 36-[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
37+if test "x$enable_thread_tls" != "xno"; then 37+if test "x$enable_thread_tls" != "xno"; then
38+ AC_LINK_IFELSE([AC_LANG_PROGRAM( 38+ AC_LINK_IFELSE([AC_LANG_PROGRAM(
39+ [[#include <pthread.h> 39+ [[#include <pthread.h>
40+ __thread int a; 40+ __thread int a;
41+ ]], 41+ ]],
42+ [a=0;])], 42+ [a=0;])],
43+ [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")]) 43+ [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
44+fi 44+fi
45 45
46 dnl *************************************************************************** 46 dnl ***************************************************************************
diff --git a/meta-oe/recipes-support/syslog-ng/files/rename-PAGESIZE-variables-to-pagesize.patch b/meta-oe/recipes-support/syslog-ng/files/rename-PAGESIZE-variables-to-pagesize.patch
new file mode 100644
index 0000000000..56ffb4a060
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/files/rename-PAGESIZE-variables-to-pagesize.patch
@@ -0,0 +1,72 @@
1From 29f0de401b9df056c7eeb47a025c341654ca579d Mon Sep 17 00:00:00 2001
2From: Andrej Valek <andrej.valek@siemens.com>
3Date: Thu, 14 Jun 2018 08:54:14 +0200
4Subject: [PATCH] secret-storage: rename PAGESIZE variables to pagesize
5
6PAGESIZE is a define in some libc libraries, which conflicts with these
7local variables.
8
9Upstream-Status: Submitted [https://github.com/balabit/syslog-ng/pull/2111]
10
11Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
12Signed-off-by: Marko Peter <peter.marko@siemens.com>
13---
14 lib/secret-storage/nondumpable-allocator.c | 4 ++--
15 lib/secret-storage/tests/test_nondumpable_allocator.c | 6 +++---
16 lib/secret-storage/tests/test_secret_storage.c | 4 ++--
17 3 files changed, 7 insertions(+), 7 deletions(-)
18
19diff --git a/lib/secret-storage/nondumpable-allocator.c b/lib/secret-storage/nondumpable-allocator.c
20index 07d94fbb0..314ce571f 100644
21--- a/lib/secret-storage/nondumpable-allocator.c
22+++ b/lib/secret-storage/nondumpable-allocator.c
23@@ -104,8 +104,8 @@ gpointer
24 nondumpable_buffer_alloc(gsize len)
25 {
26 gsize minimum_size = len + ALLOCATION_HEADER_SIZE;
27- gsize PAGESIZE = sysconf(_SC_PAGE_SIZE);
28- gsize alloc_size = round_to_nearest(minimum_size, PAGESIZE);
29+ gsize pagesize = sysconf(_SC_PAGE_SIZE);
30+ gsize alloc_size = round_to_nearest(minimum_size, pagesize);
31
32 Allocation *buffer = _mmap(alloc_size);
33 if (!buffer)
34diff --git a/lib/secret-storage/tests/test_nondumpable_allocator.c b/lib/secret-storage/tests/test_nondumpable_allocator.c
35index 6ef5b3035..a20b287ff 100644
36--- a/lib/secret-storage/tests/test_nondumpable_allocator.c
37+++ b/lib/secret-storage/tests/test_nondumpable_allocator.c
38@@ -34,10 +34,10 @@ Test(nondumpableallocator, malloc_realloc_free)
39 strcpy(buffer, test_string);
40 cr_assert_str_eq(buffer, test_string);
41
42- const gsize PAGESIZE = sysconf(_SC_PAGE_SIZE);
43- gpointer buffer_realloc = nondumpable_buffer_realloc(buffer, 2*PAGESIZE);
44+ const gsize pagesize = sysconf(_SC_PAGE_SIZE);
45+ gpointer buffer_realloc = nondumpable_buffer_realloc(buffer, 2*pagesize);
46 cr_assert_str_eq(buffer_realloc, test_string);
47- ((gchar *)buffer_realloc)[2*PAGESIZE] = 'a';
48+ ((gchar *)buffer_realloc)[2*pagesize] = 'a';
49
50 nondumpable_buffer_free(buffer_realloc);
51 }
52diff --git a/lib/secret-storage/tests/test_secret_storage.c b/lib/secret-storage/tests/test_secret_storage.c
53index 5297d4f60..89122cada 100644
54--- a/lib/secret-storage/tests/test_secret_storage.c
55+++ b/lib/secret-storage/tests/test_secret_storage.c
56@@ -263,11 +263,11 @@ Test(secretstorage, test_rlimit)
57 cr_assert(!getrlimit(RLIMIT_MEMLOCK, &locked_limit));
58 locked_limit.rlim_cur = MIN(locked_limit.rlim_max, 64 * 1024);
59 cr_assert(!setrlimit(RLIMIT_MEMLOCK, &locked_limit));
60- const gsize PAGESIZE = sysconf(_SC_PAGE_SIZE);
61+ const gsize pagesize = sysconf(_SC_PAGE_SIZE);
62
63 gchar *key_fmt = g_strdup("keyXXX");
64 int i = 0;
65- int for_limit = locked_limit.rlim_cur/PAGESIZE;
66+ int for_limit = locked_limit.rlim_cur/pagesize;
67 for (; i < for_limit; i++)
68 {
69 sprintf(key_fmt, "key%03d", i);
70--
712.11.0
72
diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
index 0c6f543551..fb183ee177 100644
--- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
+++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
@@ -1,4 +1,4 @@
1@version: 3.8 1@version: 3.15
2# 2#
3# Syslog-ng configuration file, compatible with default Debian syslogd 3# Syslog-ng configuration file, compatible with default Debian syslogd
4# installation. Originally written by anonymous (I can't find his name) 4# installation. Originally written by anonymous (I can't find his name)
diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
index 6b30c20c15..dc2ba167af 100644
--- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
+++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
@@ -7,25 +7,39 @@ Subject: [PATCH] syslog-ng.service: the syslog-ng service can not start
7Upstream-Status: pending 7Upstream-Status: pending
8 8
9Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> 9Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
10Updated-by: Andrej Valek <andrej.valek@siemens.com>
10--- 11---
11 contrib/systemd/syslog-ng.service | 5 ++--- 12 contrib/systemd/syslog-ng.service | 5 ++---
12 1 file changed, 2 insertion(+), 3 deletions(-) 13 1 file changed, 2 insertion(+), 3 deletions(-)
13 14
14diff --git a/contrib/systemd/syslog-ng.service b/contrib/systemd/syslog-ng.service 15diff --git a/contrib/systemd/syslog-ng@.service b/contrib/systemd/syslog-ng@.service
15index fc16f8d..8e09deb 100644 16index a28640e..93aec94 100644
16--- a/contrib/systemd/syslog-ng.service 17--- a/contrib/systemd/syslog-ng@.service
17+++ b/contrib/systemd/syslog-ng.service 18+++ b/contrib/systemd/syslog-ng@.service
18@@ -4,8 +4,8 @@ Description=System Logger Daemon 19@@ -7,8 +7,8 @@ Conflicts=emergency.service emergency.target
19
20 [Service]
21 Type=notify 20 Type=notify
22-ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS 21 EnvironmentFile=-/etc/default/syslog-ng@%i
22 EnvironmentFile=-/etc/sysconfig/syslog-ng@%i
23-ExecStart=/usr/sbin/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
23-ExecReload=/bin/kill -HUP $MAINPID 24-ExecReload=/bin/kill -HUP $MAINPID
24+ExecStart=@SBINDIR@/syslog-ng -F $SYSLOGNG_OPTS -p @LOCALSTATEDIR@/run/syslogd.pid 25+ExecStart=@SBINDIR@/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
25+ExecReload=@BASEBINDIR@/kill -HUP $MAINPID 26+ExecReload=@BASEBINDIR@/kill -HUP $MAINPID
26 EnvironmentFile=-/etc/default/syslog-ng
27 EnvironmentFile=-/etc/sysconfig/syslog-ng
28 StandardOutput=journal 27 StandardOutput=journal
28 StandardError=journal
29 Restart=on-failure
30diff --git a/contrib/systemd/syslog-ng@default b/contrib/systemd/syslog-ng@default
31index 02da288..3a8215d 100644
32--- a/contrib/systemd/syslog-ng@default
33+++ b/contrib/systemd/syslog-ng@default
34@@ -1,5 +1,5 @@
35 CONFIG_FILE=/etc/syslog-ng.conf
36-PERSIST_FILE=/var/lib/syslog-ng/syslog-ng.persist
37-CONTROL_FILE=/var/lib/syslog-ng/syslog-ng.ctl
38-PID_FILE=/var/run/syslog-ng.pid
39+PERSIST_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.persist
40+CONTROL_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.ctl
41+PID_FILE=@LOCALSTATEDIR@/run/syslog-ng.pid
42 OTHER_OPTIONS="--enable-core"
43
29-- 44--
301.8.4.2 451.8.4.2
31
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
index cb7ca31aee..a0ae7bd6f6 100644
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
@@ -13,7 +13,7 @@ LICENSE = "GPLv2 & LGPLv2.1"
13LIC_FILES_CHKSUM = "file://COPYING;md5=24c0c5cb2c83d9f2ab725481e4df5240" 13LIC_FILES_CHKSUM = "file://COPYING;md5=24c0c5cb2c83d9f2ab725481e4df5240"
14 14
15# util-linux added to get libuuid 15# util-linux added to get libuuid
16DEPENDS = "libpcre flex eventlog glib-2.0 openssl util-linux" 16DEPENDS = "libpcre flex glib-2.0 openssl util-linux"
17 17
18SRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \ 18SRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \
19 file://syslog-ng.conf \ 19 file://syslog-ng.conf \
@@ -69,12 +69,6 @@ do_configure_prepend() {
69 cd $olddir 69 cd $olddir
70} 70}
71 71
72do_install_prepend() {
73 sed -i -e 's,@SBINDIR@,${sbindir},g' ${S}/contrib/systemd/*.service
74 sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${S}/contrib/systemd/*.service
75 sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${S}/contrib/systemd/*.service
76}
77
78do_install_append() { 72do_install_append() {
79 install -d ${D}/${sysconfdir}/${BPN} 73 install -d ${D}/${sysconfdir}/${BPN}
80 install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${BPN}/${BPN}.conf 74 install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${BPN}/${BPN}.conf
@@ -85,6 +79,17 @@ do_install_append() {
85 install -d ${D}/${localstatedir}/lib/${BPN} 79 install -d ${D}/${localstatedir}/lib/${BPN}
86 # Remove /var/run as it is created on startup 80 # Remove /var/run as it is created on startup
87 rm -rf ${D}${localstatedir}/run 81 rm -rf ${D}${localstatedir}/run
82
83 # support for systemd
84 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
85 install -d ${D}${systemd_unitdir}/system/
86 install -m 0644 ${S}/contrib/systemd/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
87 install -m 0644 ${S}/contrib/systemd/${BPN}@default ${D}${systemd_unitdir}/system/${BPN}@default
88
89 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
90 sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
91 sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
92 fi
88} 93}
89 94
90FILES_${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools" 95FILES_${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools"
@@ -110,7 +115,7 @@ RCONFLICTS_${PN} = "busybox-syslog sysklogd rsyslog"
110RPROVIDES_${PN} += "${PN}-systemd" 115RPROVIDES_${PN} += "${PN}-systemd"
111RREPLACES_${PN} += "${PN}-systemd" 116RREPLACES_${PN} += "${PN}-systemd"
112RCONFLICTS_${PN} += "${PN}-systemd" 117RCONFLICTS_${PN} += "${PN}-systemd"
113SYSTEMD_SERVICE_${PN} = "${BPN}.service" 118SYSTEMD_SERVICE_${PN} = "${BPN}@default ${BPN}@.service"
114 119
115INITSCRIPT_NAME = "syslog" 120INITSCRIPT_NAME = "syslog"
116INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ." 121INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
new file mode 100644
index 0000000000..6d48cc3313
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
@@ -0,0 +1,11 @@
1require syslog-ng.inc
2
3SRC_URI += " \
4 file://fix-config-libnet.patch \
5 file://fix-invalid-ownership.patch \
6 file://syslog-ng.service-the-syslog-ng-service.patch \
7 file://rename-PAGESIZE-variables-to-pagesize.patch \
8"
9
10SRC_URI[md5sum] = "da59a65cd5e293ec0fa3d3ecf4984af9"
11SRC_URI[sha256sum] = "a2dabd28674e2b558e4fb92484ad111d77bf7150070aa28556827130b479f9ef"
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
deleted file mode 100644
index 91a0e46999..0000000000
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
+++ /dev/null
@@ -1,11 +0,0 @@
1require syslog-ng.inc
2
3SRC_URI += " \
4 file://fix-config-libnet.patch \
5 file://fix-invalid-ownership.patch \
6 file://Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch \
7 file://syslog-ng.service-the-syslog-ng-service.patch \
8"
9
10SRC_URI[md5sum] = "acf14563cf5ce435db8db35486ce66af"
11SRC_URI[sha256sum] = "84b081f6e5f98cbc52052e342bcfdc5de5fe0ebe9f5ec32fe9eaec5759224cc5"