Compare commits

..

2 Commits
rawhide ... f16

Author SHA1 Message Date
Jose Pedro Oliveira 5d0d6c09cb * Sync with rawhide 2011-12-14 19:40:50 +00:00
Matthias Runge 176fea62b8 version bump to fix #740772 2011-09-23 20:49:26 +02:00
10 changed files with 259 additions and 830 deletions

42
.gitignore vendored
View File

@ -3,46 +3,4 @@ syslog-ng_3.1.1.tar.gz
/syslog-ng-3.2.3-20110424.tar.bz2
/syslog-ng_3.2.3.tar.gz
/syslog-ng_3.2.4.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
/syslog-ng_3.3.7.tar.gz
/syslog-ng_3.3.8.tar.gz
/syslog-ng_3.4.0rc2.tar.gz
/syslog-ng_3.4.1.tar.gz
/syslog-ng_3.4.3.tar.gz
/syslog-ng_3.4.4.tar.gz
/syslog-ng_3.5.0beta3.tar.gz
/syslog-ng_3.5.0rc1.tar.gz
/syslog-ng_3.5.1.tar.gz
/syslog-ng_3.5.2.tar.gz
/syslog-ng_3.5.3.tar.gz
/syslog-ng_3.5.4.1.tar.gz
/syslog-ng_3.5.5.tar.gz
/syslog-ng_3.5.6.tar.gz
/syslog-ng-3.6.0rc1.tar.gz
/syslog-ng_3.6.0rc1.tar.gz
/syslog-ng_3.6.1.tar.gz
/syslog-ng_3.6.2.tar.gz
/syslog-ng-3.8.1.tar.gz
/syslog-ng-3.9.1.tar.gz
/syslog-ng-3.10.1.tar.gz
/syslog-ng-3.11.1.tar.gz
/syslog-ng-3.14.1.tar.gz
/syslog-ng-3.15.1.tar.gz
/syslog-ng-3.16.1.tar.gz
/syslog-ng-3.17.1.tar.gz
/syslog-ng-3.17.2.tar.gz
/syslog-ng-3.18.1.tar.gz
/syslog-ng-3.19.1.tar.gz
/syslog-ng-3.20.1.tar.gz
/syslog-ng-3.21.1.tar.gz
/syslog-ng-3.22.1.tar.gz
/syslog-ng-3.23.1.tar.gz
/syslog-ng-3.25.1.tar.gz
/syslog-ng-3.27.1.tar.gz
/syslog-ng-3.30.1.tar.gz
/syslog-ng-3.33.2.tar.gz
/syslog-ng-3.35.1.tar.gz
/syslog-ng-3.37.1.tar.gz

View File

@ -1 +1 @@
SHA512 (syslog-ng-3.37.1.tar.gz) = beebd89c54a415469dc58630ac1900d632ef351f6a13fad4a95ce7bb1760b16d6cfdcede02225a35e97ebce7dae151c6aa228f3d378463e8b873c4f71ed86ab7
60737452ce898f9dc7170dfdc9bfd732 syslog-ng_3.2.5.tar.gz

View File

@ -0,0 +1,18 @@
diff -ruN syslog-ng-3.2.4/tests/functional/func_test.py syslog-ng-3.2.4-modified/tests/functional/func_test.py
--- syslog-ng-3.2.4/tests/functional/func_test.py 2010-07-09 11:19:27.000000000 +0100
+++ syslog-ng-3.2.4-modified/tests/functional/func_test.py 2011-05-16 20:47:48.586752031 +0100
@@ -60,11 +60,12 @@
# import test modules
import test_file_source
import test_filters
-import test_input_drivers
+#import test_input_drivers
import test_performance
import test_sql
-tests = (test_input_drivers, test_sql, test_file_source, test_filters, test_performance)
+#tests = (test_input_drivers, test_sql, test_file_source, test_filters, test_performance)
+tests = (test_sql, test_file_source, test_filters, test_performance)
init_env()
seed_rnd()

View File

@ -0,0 +1,14 @@
diff -ruN syslog-ng-3.2.5/contrib/systemd/syslog-ng.service syslog-ng-3.2.5-modified/contrib/systemd/syslog-ng.service
--- syslog-ng-3.2.5/contrib/systemd/syslog-ng.service 2011-10-23 07:48:18.000000000 +0100
+++ syslog-ng-3.2.5-modified/contrib/systemd/syslog-ng.service 2011-11-01 19:30:09.446750825 +0000
@@ -3,8 +3,9 @@
[Service]
Sockets=syslog.socket
+EnvironmentFile=-/etc/sysconfig/syslog-ng
ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service
-ExecStart=/usr/sbin/syslog-ng -F
+ExecStart=/sbin/syslog-ng $SYSLOGNG_OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
StandardOutput=null

View File

@ -0,0 +1,88 @@
From: Balazs Scheidler <bazsi@balabit.hu>
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 <mschmidt@redhat.com>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
---
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);
}

View File

@ -1,5 +1,4 @@
@version: 3.35
@include "scl.conf"
@version:3.2
# syslog-ng configuration file.
#
@ -8,24 +7,23 @@
#
# 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);
chain_hostnames (off);
use_dns (no);
use_fqdn (no);
create_dirs (no);
keep_hostname (yes);
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);
};
source s_sys {
system();
internal();
# udp(ip(0.0.0.0) port(514));
file ("/proc/kmsg" program_override("kernel: "));
unix-dgram ("/dev/log");
internal();
# udp(ip(0.0.0.0) port(514));
};
destination d_cons { file("/dev/console"); };
@ -41,13 +39,13 @@ destination d_mlal { usertty("*"); };
filter f_kernel { facility(kern); };
filter f_default { level(info..emerg) and
not (facility(mail)
or facility(authpriv)
or facility(authpriv)
or facility(cron)); };
filter f_auth { facility(authpriv); };
filter f_mail { facility(mail); };
filter f_emergency { level(emerg); };
filter f_news { facility(uucp) or
(facility(news)
(facility(news)
and level(crit..emerg)); };
filter f_boot { facility(local7); };
filter f_cron { facility(cron); };
@ -62,9 +60,4 @@ 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:

View File

@ -1,9 +1,4 @@
/var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
{
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true

View File

@ -1,16 +0,0 @@
[Unit]
Description=System Logger Daemon
Documentation=man:syslog-ng(8)
[Service]
Type=notify
ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS -p /var/run/syslogd.pid
ExecReload=/bin/kill -HUP $MAINPID
EnvironmentFile=-/etc/default/syslog-ng
EnvironmentFile=-/etc/sysconfig/syslog-ng
StandardOutput=journal
StandardError=journal
Restart=on-failure
[Install]
WantedBy=multi-user.target

File diff suppressed because it is too large Load Diff

5
syslog-ng.sysconfig Normal file
View File

@ -0,0 +1,5 @@
#---
# Syslog-ng command line options
# See syslog-ng(8) for more details
#---
SYSLOGNG_OPTIONS="-F -p /var/run/syslogd.pid"