From 2aecaa85363f92f42ad7f7a4cc4c9e8d729c3452 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 1 Mar 2012 16:57:57 +0100 Subject: Install syslog.service Alias for newer systemd versions From the syslog.socket unit file of newer systemd versions: The default syslog implementation should make syslog.service a symlink to itself, so that this socket activates the right actual syslog service. Examples: /etc/systemd/system/syslog.service -> /lib/systemd/system/rsyslog.service /etc/systemd/system/syslog.service -> /lib/systemd/system/syslog-ng.service Best way to achieve that is by adding this to your unit file (i.e. to rsyslog.service or syslog-ng.service): [Install] Alias=syslog.service http://cgit.freedesktop.org/systemd/systemd/tree/units/syslog.socket#n26 --- rsyslog.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/rsyslog.service.in b/rsyslog.service.in index c03c9004..aa9e5db1 100644 --- a/rsyslog.service.in +++ b/rsyslog.service.in @@ -9,3 +9,4 @@ StandardOutput=null [Install] WantedBy=multi-user.target +Alias=syslog.service -- cgit From 536c9370f0773d25ee7a85aa44a10d07bc5e1420 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski Date: Fri, 2 Mar 2012 12:04:25 +0100 Subject: Fix for "/run/systemd/journal/syslog" detection Changed to check "/run/systemd/journal" directory and not the socket, as the socket may not exists [e.g. is not activated]. --- plugins/imuxsock/imuxsock.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 767f9a90..4523798f 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -67,8 +67,11 @@ MODULE_TYPE_NOKEEP #define _PATH_LOG "/dev/log" #endif #endif +#ifndef SYSTEMD_JOURNAL +#define SYSTEMD_JOURNAL "/run/systemd/journal" +#endif #ifndef SYSTEMD_PATH_LOG -#define SYSTEMD_PATH_LOG "/run/systemd/journal/syslog" +#define SYSTEMD_PATH_LOG SYSTEMD_JOURNAL "/syslog" #endif /* emulate struct ucred for platforms that do not have it */ @@ -780,7 +783,7 @@ CODESTARTwillRun listeners[0].sockName = pLogSockName; else if(sd_booted()) { struct stat st; - if(stat(SYSTEMD_PATH_LOG, &st) != -1 && S_ISSOCK(st.st_mode)) { + if(stat(SYSTEMD_JOURNAL, &st) != -1 && S_ISDIR(st.st_mode)) { listeners[0].sockName = SYSTEMD_PATH_LOG; } } -- cgit