Accepting request 106724 from Base:System
Werner: please review and forward to factory, see bnc#747871 (forwarded request 106115 from mtomaschewski) OBS-URL: https://build.opensuse.org/request/show/106724 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/syslogd?expand=0&rev=62
This commit is contained in:
@@ -41,7 +41,7 @@ test -x "${BINDIR}/$SYSLOG_DAEMON" || {
|
|||||||
case "$SYSLOG_DAEMON" in
|
case "$SYSLOG_DAEMON" in
|
||||||
rsyslogd)
|
rsyslogd)
|
||||||
syslog=rsyslogd
|
syslog=rsyslogd
|
||||||
config=/etc/rsyslog.early.conf
|
config=/etc/rsyslog.conf
|
||||||
;;
|
;;
|
||||||
syslog-ng)
|
syslog-ng)
|
||||||
syslog=syslog-ng
|
syslog=syslog-ng
|
||||||
@@ -71,22 +71,41 @@ test -x ${klog_bin} || {
|
|||||||
|
|
||||||
case "$SYSLOG_DAEMON" in
|
case "$SYSLOG_DAEMON" in
|
||||||
syslog-ng)
|
syslog-ng)
|
||||||
while read line ; do
|
case ${SYSLOG_REQUIRES_NETWORK} in
|
||||||
case "$line" in
|
yes) exit 0 ;;
|
||||||
\#*|"") continue ;;
|
no) ;;
|
||||||
*udp\ *|*udp\(*) exit 0 ;;
|
"")
|
||||||
*tcp\ *|*tcp\(*) exit 0 ;;
|
while read line ; do
|
||||||
esac
|
case "$line" in
|
||||||
done < ${config}
|
\#*|"") continue ;;
|
||||||
|
*udp\ *|*udp\(*) exit 0 ;;
|
||||||
|
*tcp\ *|*tcp\(*) exit 0 ;;
|
||||||
|
esac
|
||||||
|
done < ${config}
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
rsyslogd)
|
||||||
|
# Network is usually not required for properly configured
|
||||||
|
# rsyslogd with enabled on-disk queues for remote logging,
|
||||||
|
# so we just start it with its normal configuration.
|
||||||
|
# "yes" allows the user to disable the early start.
|
||||||
|
case ${SYSLOG_REQUIRES_NETWORK} in
|
||||||
|
yes) exit 0 ;;
|
||||||
|
no|"") ;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# in hope this works with the rsyslog.early.conf file
|
case ${SYSLOG_REQUIRES_NETWORK} in
|
||||||
# (hard to implement for rsyslog with its includes/if
|
yes) exit 0 ;;
|
||||||
# statements)...
|
no) ;;
|
||||||
while read select action ; do
|
"")
|
||||||
case "$select" in \#*|"") continue ;; esac
|
while read select action ; do
|
||||||
case "$action" in *@*) exit 0 ;; esac
|
case "$select" in \#*|"") continue ;; esac
|
||||||
done < ${config}
|
case "$action" in *@*) exit 0 ;; esac
|
||||||
|
done < ${config}
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@@ -40,15 +40,11 @@ start_klogd=yes
|
|||||||
case "$SYSLOG_DAEMON" in
|
case "$SYSLOG_DAEMON" in
|
||||||
rsyslogd)
|
rsyslogd)
|
||||||
syslog=rsyslogd
|
syslog=rsyslogd
|
||||||
mkdir -p -m 0755 /var/run/rsyslog
|
config=/etc/rsyslog.conf
|
||||||
if test "$2" = "early" ; then
|
|
||||||
config=/etc/rsyslog.early.conf
|
|
||||||
else
|
|
||||||
config=/etc/rsyslog.conf
|
|
||||||
fi
|
|
||||||
compat=${RSYSLOGD_COMPAT_VERSION:-${RSYSLOGD_NATIVE_VERSION}}
|
compat=${RSYSLOGD_COMPAT_VERSION:-${RSYSLOGD_NATIVE_VERSION}}
|
||||||
params="-c ${compat:-3} -f $config $RSYSLOGD_PARAMS"
|
params="-c ${compat:-3} -f $config $RSYSLOGD_PARAMS"
|
||||||
rsocks="/var/run/rsyslog/additional-log-sockets.conf"
|
rsocks="/var/run/rsyslog/additional-log-sockets.conf"
|
||||||
|
mkdir -p -m 0755 /var/run/rsyslog
|
||||||
test -r "$config" && \
|
test -r "$config" && \
|
||||||
while read one two rest ; do
|
while read one two rest ; do
|
||||||
test "x$one" = 'x$ModLoad' && \
|
test "x$one" = 'x$ModLoad' && \
|
||||||
|
@@ -10,3 +10,21 @@
|
|||||||
# "syslogd", "syslog-ng", "rsyslogd" or "" for autodetect.
|
# "syslogd", "syslog-ng", "rsyslogd" or "" for autodetect.
|
||||||
#
|
#
|
||||||
SYSLOG_DAEMON=""
|
SYSLOG_DAEMON=""
|
||||||
|
|
||||||
|
## Type: list(yes,no,"")
|
||||||
|
## Default: ""
|
||||||
|
## Config: ""
|
||||||
|
## ServiceRestart: syslog
|
||||||
|
#
|
||||||
|
# Specify whether the syslog configuration requires network.
|
||||||
|
# Set to "yes" to delay the syslog daemon start until network
|
||||||
|
# is already started, set to "no" to start it earlier.
|
||||||
|
#
|
||||||
|
# The behavior of the default setting "" depends on the daemon
|
||||||
|
# specified in the SYSLOG_DAEMON variable and on the current
|
||||||
|
# implementation of the init / systemd scripts. It may cause
|
||||||
|
# a try to detect whether network is required for the config
|
||||||
|
# or choose one of the above modi.
|
||||||
|
#
|
||||||
|
SYSLOG_REQUIRES_NETWORK=""
|
||||||
|
|
||||||
|
29
sysklogd-1.4.1-systemd-sock-name.patch
Normal file
29
sysklogd-1.4.1-systemd-sock-name.patch
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
--- syslogd.c
|
||||||
|
+++ syslogd.c 2012/02/20 19:41:22
|
||||||
|
@@ -558,6 +558,10 @@ static char sccsid[] __attribute__ ((un
|
||||||
|
#define _PATH_LOG "/dev/log"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#ifndef SYSTEMD_PATH_LOG
|
||||||
|
+#define SYSTEMD_PATH_LOG "/run/systemd/journal/syslog"
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
char *ConfFile = _PATH_LOGCONF;
|
||||||
|
char *PidFile = _PATH_LOGPID;
|
||||||
|
char ctty[] = _PATH_CONSOLE;
|
||||||
|
@@ -889,6 +893,15 @@ int main(argc, argv)
|
||||||
|
funix[i] = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* systemd >= 38 wants we use /run/systemd/journal/syslog,
|
||||||
|
+ * instead of /dev/log, but allow to override it using -p */
|
||||||
|
+ if(sd_booted()) {
|
||||||
|
+ struct stat st;
|
||||||
|
+ if(stat(SYSTEMD_PATH_LOG, &st) != -1 && S_ISSOCK(st.st_mode)) {
|
||||||
|
+ funixn[0] = SYSTEMD_PATH_LOG;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:tvS")) != EOF)
|
||||||
|
switch((char)ch) {
|
||||||
|
case 'a':
|
@@ -86,15 +86,22 @@ syslog-ng)
|
|||||||
config=/etc/syslog-ng/syslog-ng.conf
|
config=/etc/syslog-ng/syslog-ng.conf
|
||||||
socksdir=/var/run/syslog-ng
|
socksdir=/var/run/syslog-ng
|
||||||
socks=$socksdir/additional-log-sockets.conf
|
socks=$socksdir/additional-log-sockets.conf
|
||||||
if test -s "$config" ; then
|
case ${SYSLOG_REQUIRES_NETWORK} in
|
||||||
while read line ; do
|
yes) network=network.target ;;
|
||||||
case "$line" in
|
no) ;;
|
||||||
\#*|"") continue ;;
|
"") # OK, try to detect it; does not
|
||||||
*udp\ *|*udp\(*) network=network.target ;;
|
# work with include files ...
|
||||||
*tcp\ *|*tcp\(*) network=network.target ;;
|
if test -s "$config" ; then
|
||||||
esac
|
while read line ; do
|
||||||
done < ${config}
|
case "$line" in
|
||||||
fi
|
\#*|"") continue ;;
|
||||||
|
*udp\ *|*udp\(*) network=network.target ;;
|
||||||
|
*tcp\ *|*tcp\(*) network=network.target ;;
|
||||||
|
esac
|
||||||
|
done < ${config}
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
if test -r "$config" ; then
|
if test -r "$config" ; then
|
||||||
while read line; do
|
while read line; do
|
||||||
case $line in
|
case $line in
|
||||||
@@ -113,26 +120,13 @@ rsyslogd)
|
|||||||
config=/etc/rsyslog.conf
|
config=/etc/rsyslog.conf
|
||||||
socksdir=/var/run/rsyslog
|
socksdir=/var/run/rsyslog
|
||||||
socks=$socksdir/additional-log-sockets.conf
|
socks=$socksdir/additional-log-sockets.conf
|
||||||
#
|
# Network is usually not required for properly configured
|
||||||
# In hope this works with the rsyslog.early.conf file
|
# rsyslogd with enabled on-disk queues for remote logging,
|
||||||
# (hard to implement for rsyslog with its includes/if
|
# so we just start it with its normal configuration.
|
||||||
# statements)...
|
# "yes" allows the user to disable the early start.
|
||||||
#
|
case ${SYSLOG_REQUIRES_NETWORK} in
|
||||||
if test -s "$config" ; then
|
yes) network=network.target ;;
|
||||||
while read select action ; do
|
esac
|
||||||
case "$select" in
|
|
||||||
\#*|"")
|
|
||||||
continue
|
|
||||||
esac
|
|
||||||
case "$action" in
|
|
||||||
*@*)
|
|
||||||
network=network.target
|
|
||||||
break
|
|
||||||
esac
|
|
||||||
done < ${config}
|
|
||||||
else
|
|
||||||
config=/etc/rsyslog.early.conf
|
|
||||||
fi
|
|
||||||
if test -r "$config" ; then
|
if test -r "$config" ; then
|
||||||
while read one two rest ; do
|
while read one two rest ; do
|
||||||
if test "$one" = '$ModLoad' -a "$two" = 'imklog.so' ; then
|
if test "$one" = '$ModLoad' -a "$two" = 'imklog.so' ; then
|
||||||
@@ -151,12 +145,19 @@ rsyslogd)
|
|||||||
config=/etc/syslog.conf
|
config=/etc/syslog.conf
|
||||||
socksdir=/var/run/syslog
|
socksdir=/var/run/syslog
|
||||||
socks=$socksdir/additional-log-sockets.env
|
socks=$socksdir/additional-log-sockets.env
|
||||||
if test -s "$config" ; then
|
network=
|
||||||
while read select action ; do
|
case ${SYSLOG_REQUIRES_NETWORK} in
|
||||||
case "$select" in \#*|"") continue ;; esac
|
yes) network=network.target ;;
|
||||||
case "$action" in *@*) network=network.target ;; esac
|
no) ;;
|
||||||
done < ${config}
|
"") # Try to detect it
|
||||||
fi
|
if test -s "$config" ; then
|
||||||
|
while read select action ; do
|
||||||
|
case "$select" in \#*|"") continue ;; esac
|
||||||
|
case "$action" in *@*) network=network.target ;; esac
|
||||||
|
done < ${config}
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
/bin/mkdir -p -m 0755 ${socksdir#/var}
|
/bin/mkdir -p -m 0755 ${socksdir#/var}
|
||||||
touch ${socks#/var}
|
touch ${socks#/var}
|
||||||
params="$SYSLOGD_PARAMS"
|
params="$SYSLOGD_PARAMS"
|
||||||
|
@@ -1,3 +1,19 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 20 19:43:28 UTC 2012 - mt@suse.com
|
||||||
|
|
||||||
|
- Detect if we have to use the new /run/systemd/journal/syslog
|
||||||
|
socket instead of the /dev/log under newer systemd versions.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 20 12:25:12 UTC 2012 - mt@suse.com
|
||||||
|
|
||||||
|
- syslog-service: Added SYSLOG_REQUIRES_NETWORK variable allowing
|
||||||
|
the user to configure (override) whether the syslog daemon config
|
||||||
|
requires network or can be started early. Default is to detect
|
||||||
|
it for syslogd and syslog-ng and to just start rsyslogd early
|
||||||
|
with its normal config. Removed the rsyslog.early.conf use as it
|
||||||
|
is usually not needed [enable on-disk queues] (bnc#728565).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Feb 3 16:31:30 UTC 2012 - werner@suse.de
|
Fri Feb 3 16:31:30 UTC 2012 - werner@suse.de
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package syslogd
|
# spec file for package syslogd
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -71,6 +71,7 @@ Patch22: sysklogd-1.4.1-sysmap-prior-to-2.5.patch
|
|||||||
Patch23: sysklogd-1.4.1-reload.dif
|
Patch23: sysklogd-1.4.1-reload.dif
|
||||||
Patch24: sysklogd-1.4.1-systemd.dif
|
Patch24: sysklogd-1.4.1-systemd.dif
|
||||||
Patch25: sysklogd-1.4.1-systemd-multi.dif
|
Patch25: sysklogd-1.4.1-systemd-multi.dif
|
||||||
|
Patch26: sysklogd-1.4.1-systemd-sock-name.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
%{expand: %%global sysdsysunitdir %(pkg-config systemd --variable=systemdsystemunitdir)}
|
%{expand: %%global sysdsysunitdir %(pkg-config systemd --variable=systemdsystemunitdir)}
|
||||||
%{expand: %%global sysdsysconfdir %(pkg-config systemd --variable=systemdsystemconfdir)}
|
%{expand: %%global sysdsysconfdir %(pkg-config systemd --variable=systemdsystemconfdir)}
|
||||||
@@ -162,6 +163,7 @@ Authors:
|
|||||||
%patch23 -p0 -b .reload
|
%patch23 -p0 -b .reload
|
||||||
%patch24 -p0 -b .sd
|
%patch24 -p0 -b .sd
|
||||||
%patch25 -p0 -b .sd2
|
%patch25 -p0 -b .sd2
|
||||||
|
%patch26 -p0 -b .sd3
|
||||||
%patch0 -p0
|
%patch0 -p0
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
Reference in New Issue
Block a user