diff --git a/.gitignore b/.gitignore index 1d143c6..a6cc477 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ syslog-ng_3.1.1.tar.gz /syslog-ng-3.2.4+20111022+0801.tar.gz /syslog-ng-3.2.4+20111023+0856.tar.gz /syslog-ng_3.2.5.tar.gz +/syslog-ng-3.3.6.91-20121008-v3.3.6.91.tar.gz diff --git a/sources b/sources index de5cbb7..5140411 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -60737452ce898f9dc7170dfdc9bfd732 syslog-ng_3.2.5.tar.gz +9c6d1576126028e78c533a3a4159f939 syslog-ng-3.3.6.91-20121008-v3.3.6.91.tar.gz diff --git a/syslog-ng-3.2.5-syslog-ng.service.patch b/syslog-ng-3.2.5-syslog-ng.service.patch deleted file mode 100644 index e6be1f9..0000000 --- a/syslog-ng-3.2.5-syslog-ng.service.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -ruN syslog-ng-3.2.5-orig/contrib/systemd/syslog-ng.service syslog-ng-3.2.5/contrib/systemd/syslog-ng.service ---- syslog-ng-3.2.5-orig/contrib/systemd/syslog-ng.service 2011-10-23 07:48:18.000000000 +0100 -+++ syslog-ng-3.2.5/contrib/systemd/syslog-ng.service 2012-06-19 23:34:08.609378950 +0100 -@@ -3,8 +3,7 @@ - - [Service] - Sockets=syslog.socket --ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service --ExecStart=/usr/sbin/syslog-ng -F -+ExecStart=/usr/sbin/syslog-ng -F -p /var/run/syslogd.pid - ExecReload=/bin/kill -HUP $MAINPID - StandardOutput=null - diff --git a/syslog-ng-3.2.5-tests-functional-sql-test.patch b/syslog-ng-3.2.5-tests-functional-sql-test.patch deleted file mode 100644 index 73e5f60..0000000 --- a/syslog-ng-3.2.5-tests-functional-sql-test.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -ruN syslog-ng-3.2.5/tests/functional/globals.py syslog-ng-3.2.5-modified/tests/functional/globals.py ---- syslog-ng-3.2.5/tests/functional/globals.py 2011-10-08 11:34:21.000000000 +0100 -+++ syslog-ng-3.2.5-modified/tests/functional/globals.py 2012-01-15 05:34:12.641744234 +0000 -@@ -7,7 +7,7 @@ - return False - - def has_module(module): -- avail_mods = os.popen('../../syslog-ng/syslog-ng -V | grep ^Available-Modules: ', 'r').read() -+ avail_mods = os.popen('../../syslog-ng/syslog-ng -V | grep "^Enable-%s: on"' % module, 'r').read() - if avail_mods.find(module) != -1: - return True - return False -diff -ruN syslog-ng-3.2.5/tests/functional/test_sql.py syslog-ng-3.2.5-modified/tests/functional/test_sql.py ---- syslog-ng-3.2.5/tests/functional/test_sql.py 2011-10-08 11:34:21.000000000 +0100 -+++ syslog-ng-3.2.5-modified/tests/functional/test_sql.py 2012-01-15 05:37:56.699303941 +0000 -@@ -28,7 +28,7 @@ - - def check_env(): - -- if not has_module('afsql'): -+ if not has_module('SQL'): - print 'afsql module is not available, skipping SQL test' - return False - paths=('/opt/syslog-ng/bin', '/usr/bin', '/usr/local/bin') -@@ -45,7 +45,7 @@ - soext='.sl' - - found = False -- paths = (os.environ.get('dbd_dir', None), '/usr/local/lib/dbd', '/usr/lib/dbd', '/opt/syslog-ng/lib/dbd') -+ paths = (os.environ.get('dbd_dir', None), '/usr/local/lib/dbd', '/usr/lib/dbd', '/usr/lib64/dbd', '/opt/syslog-ng/lib/dbd') - for pth in paths: - if pth and os.path.isfile('%s/libdbdsqlite3%s' % (pth, soext)): - found = True diff --git a/syslog-ng-3.3.4-afunix.c-diagnostic-messages.patch b/syslog-ng-3.3.4-afunix.c-diagnostic-messages.patch deleted file mode 100644 index 86e3b4d..0000000 --- a/syslog-ng-3.3.4-afunix.c-diagnostic-messages.patch +++ /dev/null @@ -1,88 +0,0 @@ -From: Balazs Scheidler -Date: Wed, 14 Dec 2011 14:21:05 +0000 (+0100) -Subject: afunix: clarified error messages in case of a failure -X-Git-Url: http://git.balabit.hu/?p=bazsi%2Fsyslog-ng-3.3.git;a=commitdiff_plain;h=606c8cc0b10aa4e877f70726b707402d100bb0f9 - -afunix: clarified error messages in case of a failure - -On Fedora systems, syslog-ng was configured to use unix-stream() /dev/log -whereas systemd supplied a unix-dgram() one, which caused difficult to -diagnose problems. - -This patch adds further logging to this case and causes syslog-ng to fail -with an error message if it finds that /dev/log is using an incorrect -socket type. - -Reported-By: Michal Schmidt -Signed-off-by: Balazs Scheidler ---- - -diff --git a/modules/afsocket/afunix.c b/modules/afsocket/afunix.c -index cd86798..8145f1a 100644 ---- a/modules/afsocket/afunix.c -+++ b/modules/afsocket/afunix.c -@@ -75,7 +75,7 @@ static gboolean - afunix_sd_acquire_socket(AFSocketSourceDriver *s, gint *result_fd) - { - AFUnixSourceDriver *self = (AFUnixSourceDriver *) s; -- gint fd, fds, t, r; -+ gint fd, fds; - - *result_fd = -1; - fd = -1; -@@ -100,13 +100,40 @@ afunix_sd_acquire_socket(AFSocketSourceDriver *s, gint *result_fd) - { - for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + fds; fd++) - { -- t = (self->super.flags & AFSOCKET_STREAM) ? SOCK_STREAM : SOCK_DGRAM; -- r = sd_is_socket_unix(fd, t, -1, self->filename, 0); -- if (r == 1) -+ /* check if any type is available */ -+ if (sd_is_socket_unix(fd, 0, -1, self->filename, 0)) - { -- *result_fd = fd; -- break; -- } -+ int type = (self->super.flags & AFSOCKET_STREAM) ? SOCK_STREAM : SOCK_DGRAM; -+ -+ /* check if it matches our idea of the socket type */ -+ if (sd_is_socket_unix(fd, type, -1, self->filename, 0)) -+ { -+ *result_fd = fd; -+ break; -+ } -+ else -+ { -+ msg_error("The systemd supplied UNIX domain socket is of a different type, check the configured driver and the matching systemd unit file", -+ evt_tag_str("filename", self->filename), -+ evt_tag_int("systemd-sock-fd", fd), -+ evt_tag_str("expecting", type == SOCK_STREAM ? "unix-stream()" : "unix-dgram()"), -+ NULL); -+ return FALSE; -+ } -+ } -+ else -+ { -+ -+ /* systemd passed an fd we didn't really care about. This is -+ * not an error, but might be worth mentioning it at the debug -+ * level. -+ */ -+ -+ msg_debug("Ignoring systemd supplied fd as it is not a UNIX domain socket", -+ evt_tag_str("filename", self->filename), -+ evt_tag_int("systemd-sock-fd", fd), -+ NULL); -+ } - } - } - else -@@ -123,7 +150,7 @@ afunix_sd_acquire_socket(AFSocketSourceDriver *s, gint *result_fd) - } - else - { -- msg_debug("Failed to acquire systemd socket, opening nevertheless", -+ msg_debug("Failed to acquire systemd socket, trying to open ourselves", - evt_tag_str("filename", self->filename), - NULL); - } diff --git a/syslog-ng-3.3.6-syslog-ng.service.patch b/syslog-ng-3.3.6-syslog-ng.service.patch new file mode 100644 index 0000000..f17cc97 --- /dev/null +++ b/syslog-ng-3.3.6-syslog-ng.service.patch @@ -0,0 +1,12 @@ +diff -ruN syslog-ng-3.3.5-orig/contrib/systemd/syslog-ng.service syslog-ng-3.3.5/contrib/systemd/syslog-ng.service +--- syslog-ng-3.3.5-orig/contrib/systemd/syslog-ng.service 2012-06-27 01:15:11.000000000 +0100 ++++ syslog-ng-3.3.5/contrib/systemd/syslog-ng.service 2012-06-28 01:16:02.587991449 +0100 +@@ -4,7 +4,7 @@ + + [Service] + Sockets=syslog.socket +-ExecStart=/usr/sbin/syslog-ng -F ++ExecStart=/usr/sbin/syslog-ng -F -p /var/run/syslogd.pid + ExecReload=/bin/kill -HUP $MAINPID + StandardOutput=null + diff --git a/syslog-ng-3.3.6-tests-functional-sql-test.patch b/syslog-ng-3.3.6-tests-functional-sql-test.patch new file mode 100644 index 0000000..8fa2764 --- /dev/null +++ b/syslog-ng-3.3.6-tests-functional-sql-test.patch @@ -0,0 +1,12 @@ +diff -ruN syslog-ng-3.3.3/tests/functional/globals.py syslog-ng-3.3.3-modified/tests/functional/globals.py +--- syslog-ng-3.3.3/tests/functional/globals.py 2011-09-20 07:39:14.000000000 +0100 ++++ syslog-ng-3.3.3-modified/tests/functional/globals.py 2012-01-16 01:39:24.206723249 +0000 +@@ -7,7 +7,7 @@ + return False + + def has_module(module): +- avail_mods = os.popen('../../syslog-ng/syslog-ng -V | grep ^Available-Modules: ', 'r').read() ++ avail_mods = os.popen('../../syslog-ng/syslog-ng -V | grep ^Default-Modules: ', 'r').read() + if avail_mods.find(module) != -1: + return True + return False diff --git a/syslog-ng.conf b/syslog-ng.conf index a4f20a9..2ce866e 100644 --- a/syslog-ng.conf +++ b/syslog-ng.conf @@ -1,4 +1,4 @@ -@version:3.2 +@version:3.3 # syslog-ng configuration file. # @@ -7,23 +7,25 @@ # # See syslog-ng(8) and syslog-ng.conf(5) for more information. # +# Note: it also sources additional configuration files (*.conf) +# located in /etc/syslog-ng/conf.d/ options { - flush_lines (0); - time_reopen (10); - log_fifo_size (1000); - long_hostnames (off); - use_dns (no); - use_fqdn (no); - create_dirs (no); - keep_hostname (yes); + flush_lines (0); + time_reopen (10); + log_fifo_size (1000); + chain_hostnames (off); + use_dns (no); + use_fqdn (no); + create_dirs (no); + keep_hostname (yes); }; source s_sys { - file ("/proc/kmsg" program_override("kernel: ")); - unix-dgram ("/dev/log"); - internal(); - # udp(ip(0.0.0.0) port(514)); + file ("/proc/kmsg" program_override("kernel") flags(kernel)); + unix-dgram ("/dev/log"); + internal(); + # udp(ip(0.0.0.0) port(514)); }; destination d_cons { file("/dev/console"); }; @@ -60,4 +62,9 @@ log { source(s_sys); filter(f_news); destination(d_spol); }; log { source(s_sys); filter(f_boot); destination(d_boot); }; log { source(s_sys); filter(f_cron); destination(d_cron); }; + +# Source additional configuration files (.conf extension only) +@include "/etc/syslog-ng/conf.d/*.conf" + + # vim:ft=syslog-ng:ai:si:ts=4:sw=4:et: diff --git a/syslog-ng.spec b/syslog-ng.spec index 285ca14..5af0827 100644 --- a/syslog-ng.spec +++ b/syslog-ng.spec @@ -1,30 +1,33 @@ %global evtlog_ver 0.2.12 +%global ivykis-ver 0.30.4 Name: syslog-ng -Version: 3.2.5 -Release: 16%{?dist} +Version: 3.3.7 +Release: 0.1.rc2%{?dist} Summary: Next-generation syslog server Group: System Environment/Daemons License: GPLv2+ Url: http://www.balabit.com/network-security/syslog-ng -Source0: http://www.balabit.com/downloads/files?path=/syslog-ng/sources/%{version}/source/%{name}_%{version}.tar.gz +#Source0: http://www.balabit.com/downloads/files?path=/syslog-ng/sources/%{version}/source/%{name}_%{version}.tar.gz +Source0: http://packages.madhouse-project.org/syslog-ng/3.3/3.3.6.91/syslog-ng-3.3.6.91-20121008-v3.3.6.91.tar.gz Source1: syslog-ng.conf Source2: syslog-ng.logrotate -Patch0: syslog-ng-3.2.5-syslog-ng.service.patch -Patch1: syslog-ng-3.3.4-afunix.c-diagnostic-messages.patch -Patch2: syslog-ng-3.2.5-tests-functional-control.py.patch -Patch3: syslog-ng-3.2.5-tests-functional-sql-test.patch - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch0: syslog-ng-3.3.6-syslog-ng.service.patch +Patch1: syslog-ng-3.2.5-tests-functional-control.py.patch +Patch2: syslog-ng-3.3.6-tests-functional-sql-test.patch BuildRequires: systemd-units BuildRequires: pkgconfig BuildRequires: libtool +BuildRequires: bison, flex BuildRequires: eventlog-devel >= %{evtlog_ver} BuildRequires: glib2-devel >= 2.10.1 -#BuildRequires: libcap-devel +BuildRequires: ivykis-devel >= %{ivykis-ver} +BuildRequires: json-c-devel +#BuildRequires: json-glib-devel +BuildRequires: libcap-devel BuildRequires: libdbi-devel BuildRequires: libnet-devel BuildRequires: openssl-devel @@ -37,6 +40,7 @@ BuildRequires: python BuildRequires: libdbi-dbd-sqlite Requires: logrotate +Requires: ivykis >= %{ivykis-ver} Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units @@ -80,11 +84,10 @@ developing applications that use %{name}. %prep -%setup -q +%setup -q -n %{name}-3.3.6.91 %patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch3 -p1 # fix perl path %{__sed} -i 's|^#!/usr/local/bin/perl|#!%{__perl}|' contrib/relogger.pl @@ -96,6 +99,8 @@ developing applications that use %{name}. /usr/bin/iconv -f iso8859-1 -t utf-8 AUTHORS > AUTHORS.conv && \ %{__mv} -f AUTHORS.conv AUTHORS +# create an ld.so conf file +echo %{_libdir}/%{name} > %{name}-%{_arch}.conf %build %configure \ @@ -105,12 +110,14 @@ developing applications that use %{name}. --datadir=%{_datadir}/%{name} \ --with-module-dir=/%{_libdir}/%{name} \ --with-systemdsystemunitdir=%{_unitdir} \ + --with-ivykis=system \ --enable-ipv6 \ --enable-tcp-wrapper \ --enable-pcre \ --enable-spoof-source \ - --disable-linux-caps \ + --enable-linux-caps \ --enable-sql \ + --enable-json \ --enable-ssl \ --enable-shared \ --disable-static \ @@ -125,10 +132,9 @@ make %{_smp_mflags} %install -%{__rm} -rf %{buildroot} make DESTDIR=%{buildroot} install -#%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/%{name} +%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/%{name}/conf.d %{__install} -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/syslog-ng.conf %{__install} -d -m 755 %{buildroot}%{_sysconfdir}/logrotate.d @@ -142,6 +148,10 @@ make DESTDIR=%{buildroot} install %{__install} -p -m 644 config.h %{buildroot}%{_includedir}/%{name} %{__install} -p -m 644 lib/*.h %{buildroot}%{_includedir}/%{name} +# install the ld.so conf file +%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/ld.so.conf.d/ +%{__install} -p -m 644 %{name}-%{_arch}.conf %{buildroot}%{_sysconfdir}/ld.so.conf.d/ + # install vim files %{__install} -d -m 755 %{buildroot}%{_datadir}/%{name} %{__install} -p -m 644 contrib/syslog-ng.vim %{buildroot}%{_datadir}/%{name} @@ -159,29 +169,26 @@ find %{buildroot} -name "*.la" -exec rm -f {} \; LD_LIBRARY_PATH=%{buildroot}/%{_libdir}:%{buildroot}/%{_libdir}/%{name} make check -%clean -rm -rf %{buildroot} - - %post -/sbin/ldconfig -if [ $1 -eq 1 ] ; then - # Initial installation - /bin/systemctl daemon-reload >/dev/null 2>&1 || : +ldconfig +if [ $1 -eq 1 ] ; then + # Initial installation + systemctl daemon-reload &>/dev/null || : fi %preun if [ $1 -eq 0 ] ; then # Package removal, not upgrade - /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || : - /bin/systemctl stop %{name}.service >/dev/null 2>&1 || : + systemctl --no-reload disable %{name}.service &>/dev/null || : + systemctl stop %{name}.service &>/dev/null || : fi %postun -/sbin/ldconfig +ldconfig +systemctl daemon-reload &>/dev/null || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall - /bin/systemctl condrestart %{name}.service >/dev/null 2>&1 || : + systemctl condrestart %{name}.service &>/dev/null || : fi @@ -213,17 +220,18 @@ fi %files -%defattr(-,root,root,-) -%doc AUTHORS COPYING README ChangeLog NEWS +%doc AUTHORS COPYING ChangeLog NEWS %doc doc/security/*.txt %doc contrib/{relogger.pl,syslog2ng,syslog-ng.conf.doc} %dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name}/conf.d %dir %{_sysconfdir}/%{name}/patterndb.d %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf %config(noreplace) %{_sysconfdir}/%{name}/modules.conf %config(noreplace) %{_sysconfdir}/%{name}/scl.conf %config(noreplace) %{_sysconfdir}/logrotate.d/syslog +%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf %{_unitdir}/%{name}.service %dir %{_sharedstatedir}/%{name} @@ -232,7 +240,8 @@ fi %{_bindir}/loggen %{_bindir}/pdbtool %{_bindir}/update-patterndb -%{_libdir}/lib%{name}.so.* +#{_libdir}/lib%{name}-%{version}.so +%{_libdir}/lib%{name}-3.3.6.91.so %{_libdir}/%{name}/*.so %exclude %{_libdir}/%{name}/libafsql.so @@ -253,16 +262,38 @@ fi %{_mandir}/man8/syslog-ng.8* %files libdbi -%defattr(-,root,root,-) %{_libdir}/%{name}/libafsql.so %files devel -%defattr(-,root,root,-) %{_libdir}/libsyslog-ng.so %{_includedir}/%{name}/ +%{_libdir}/pkgconfig/syslog-ng.pc +%{_datadir}/%{name}/tools/ %changelog +* Thu Oct 18 2012 Jose Pedro Oliveira - 3.3.7-0.1.rc2 +- Update to 3.3.7 RC2 (aka syslog-ng-3.3.6.91-20121008-v3.3.6.91.tar.gz) +- Create and own the /etc/syslog-ng/conf.d directory +- syslog-ng.conf: now sources additional configuration files located at + /etc/syslog-ng/conf.d ; these files must have a .conf extension +- syslog-ng.conf: make the s_sys source more compliant with the one + generated by generate-system-source.sh +- syslog-ng.conf: retab +- Bump the minimal ivykis version requirement to 0.30.4 + +* Mon Aug 27 2012 Jose Pedro Oliveira - 3.3.6-1 +- Update to 3.3.6 +- Now builds with an external (and unpatched) version of the ivykis library (>= 0.30.1) +- Enable JSON support (BR json-c-devel). +- Enable Linux caps (BR libcap-devel). +- BR bison and flex +- syslog-ng.conf: rename the now obsolete long_hostnames option to chain_hostnames +- install a ld.so conf file so that the private shared library - + libsyslog-ng-crypto - can be found. +- Unconditionally run "systemctl daemon-reload" on the %%postun scriptlet + (https://bugzilla.redhat.com/show_bug.cgi?id=700766#c25) + * Sat Jul 21 2012 Fedora Release Engineering - 3.2.5-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild