Hello community, here is the log from the commit of package syslog-ng for openSUSE:Factory checked in at 2012-02-24 06:54:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/syslog-ng (Old) and /work/SRC/openSUSE:Factory/.syslog-ng.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "syslog-ng", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/syslog-ng/syslog-ng.changes 2012-01-30 12:28:46.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.syslog-ng.new/syslog-ng.changes 2012-02-24 06:54:31.000000000 +0100 @@ -1,0 +2,9 @@ +Thu Feb 23 16:21:05 UTC 2012 - [email protected] + +- Detect if we have to use the new /run/systemd/journal/syslog + socket under newer systemd versions, instead of the default + _PATH_LOG (/dev/log) socket. Avoids update problems and the + need to adopt config before using init=... boot parameter + (bnc#747871). + +------------------------------------------------------------------- New: ---- syslog-ng-3.3.4-sd-sock-name.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ syslog-ng.spec ++++++ --- /var/tmp/diff_new_pack.hQ7sMA/_old 2012-02-24 06:54:32.000000000 +0100 +++ /var/tmp/diff_new_pack.hQ7sMA/_new 2012-02-24 06:54:32.000000000 +0100 @@ -40,6 +40,7 @@ Source2: syslog-ng.sysconfig Source3: syslog-ng.conf.default Patch0: syslog-ng-%{version}-less-static.diff +Patch1: syslog-ng-3.3.4-sd-sock-name.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison BuildRequires: flex @@ -144,6 +145,7 @@ %if 0%{suse_version} <= 1130 %patch0 -p0 %endif +%patch1 -p1 cp -a $RPM_SOURCE_DIR/syslog-ng.rc-script . cp -a $RPM_SOURCE_DIR/syslog-ng.conf.default . ++++++ syslog-ng-3.3.4-sd-sock-name.patch ++++++ >From da1d7a240090021188db1bb818159ca1999d54e0 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <[email protected]> Date: Thu, 23 Feb 2012 17:08:55 +0100 Subject: [PATCH] Detect if to use /run/systemd/journal/syslog under systemd Detect if we have to use the new /run/systemd/journal/syslog socket under newer systemd versions, instead of the default _PATH_LOG (/dev/log) socket. Signed-off-by: Marius Tomaschewski <[email protected]> --- modules/afsocket/afunix.c | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/modules/afsocket/afunix.c b/modules/afsocket/afunix.c index 8145f1a..5fe600a 100644 --- a/modules/afsocket/afunix.c +++ b/modules/afsocket/afunix.c @@ -34,12 +34,25 @@ #include <string.h> #include <sys/types.h> +#include <sys/syslog.h> #include <sys/socket.h> #include <sys/un.h> #include <sys/stat.h> #include <unistd.h> #include <stdlib.h> +#if ENABLE_SYSTEMD +/* + * default log socket name is usually defined + * as _PATH_LOG in the sys/socket.h (/dev/log + * on linux or /var/run/log on bsd), but under + * systemd, we have to use a different one... + */ +#ifndef SYSTEMD_PATH_LOG +#define SYSTEMD_PATH_LOG "/run/systemd/journal/syslog" +#endif +#endif + void afunix_sd_set_uid(LogDriver *s, gchar *owner) { @@ -228,6 +241,22 @@ afunix_sd_new(gchar *filename, guint32 flags) else if (self->super.flags & AFSOCKET_STREAM) afsocket_sd_set_transport(&self->super.super.super, "unix-stream"); +#if defined(_PATH_LOG) && ENABLE_SYSTEMD + /* + * systemd >= 38 wants we use /run/systemd/journal/syslog, + * instead of /dev/log, so use it when the socket exists... + */ + if(sd_booted() && strcmp(filename, _PATH_LOG) == 0) { + struct stat st; + if(stat(SYSTEMD_PATH_LOG, &st) != -1 && S_ISSOCK(st.st_mode)) { + msg_debug("Systemd socket name override", + evt_tag_str("log-socket-old", filename), + evt_tag_str("log-socket-new", SYSTEMD_PATH_LOG), + NULL); + filename = SYSTEMD_PATH_LOG; + } + } +#endif self->filename = g_strdup(filename); self->owner = -1; self->group = -1; -- 1.7.7 -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
