Accepting request 147911 from Base:System

- Fixed changelog to refer to bnc#790298 instead #90298
- Enable rsyslog.service and create the syslog.service alias link
  in post install -- regardless of a preset config (bnc#790805).
- Check the existence of /etc/init.d/syslog script before calling
  the restart_on_update and stop_on_removal macros to avoid errors
  on update. Since openSUSE 12.3, no syslog init script is shipped
  (bnc#790298,bnc#750478).
- Update to 7.2.4 [v7-stable] with following changes

OBS-URL: https://build.opensuse.org/request/show/147911
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rsyslog?expand=0&rev=62
This commit is contained in:
Stephan Kulow 2013-01-10 16:11:20 +00:00 committed by Git OBS Bridge
commit 782075bd9b
5 changed files with 74 additions and 403 deletions

View File

@ -1,392 +0,0 @@
From 4983890fa26a6c6443a1fec591c47956be8a5567 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards <rgerhards@adiscon.com>
Date: Wed, 17 Oct 2012 17:17:43 +0200
Subject: [PATCH 1/5] imklog: add paramter "keepkerneltimestamp"
Thanks to Marius Tomaschweski for the suggestion and a patch (for v5)
that this commit bases on.
---
doc/imklog.html | 6 +++---
plugins/imklog/bsd.c | 25 ++++++++++++-------------
plugins/imklog/imklog.c | 5 +++++
plugins/imklog/imklog.h | 1 +
4 Dateien geändert, 21 Zeilen hinzugefügt(+), 16 Zeilen entfernt(-)
diff --git a/doc/imklog.html b/doc/imklog.html
index 2e3b3bc..6ccdb5b 100644
--- a/doc/imklog.html
+++ b/doc/imklog.html
@@ -1,8 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
-<meta http-equiv="Content-Language" content="en"><title>Kernel Log Input Module (imklog)</title>
-
+<title>Kernel Log Input Module (imklog)</title>
</head>
+
<body>
<a href="rsyslog_conf_modules.html">back</a>
@@ -85,7 +85,7 @@ is needed to start pulling kernel messages.<br>
<p><font size="2">This documentation is part of the
<a href="http://www.rsyslog.com/">rsyslog</a>
project.<br>
-Copyright &copy; 2008-2009 by <a href="http://www.gerhards.net/rainer">Rainer
+Copyright &copy; 2008-2012 by <a href="http://www.gerhards.net/rainer">Rainer
Gerhards</a> and
<a href="http://www.adiscon.com/">Adiscon</a>.
Released under the GNU GPL version 3 or higher.</font></p>
diff --git a/plugins/imklog/bsd.c b/plugins/imklog/bsd.c
index d4f9f77..ad194b5 100644
--- a/plugins/imklog/bsd.c
+++ b/plugins/imklog/bsd.c
@@ -58,9 +58,6 @@ static int fklog = -1; /* kernel log fd */
#ifdef OS_LINUX
/* submit a message to imklog Syslog() API. In this function, we check if
* a kernel timestamp is present and, if so, extract and strip it.
- * Note: this is an extra processing step. We should revisit the whole
- * idea in v6 and remove all that old stuff that we do not longer need
- * (like symbol resolution). <-- TODO
* Note that this is heavily Linux specific and thus is not compiled or
* used for BSD.
* Special thanks to Lennart Poettering for suggesting on how to convert
@@ -73,7 +70,7 @@ static int fklog = -1; /* kernel log fd */
* rgerhards, 2011-06-24
*/
static void
-submitSyslog(int pri, uchar *buf)
+submitSyslog(modConfData_t *pModConf, int pri, uchar *buf)
{
long secs;
long nsecs;
@@ -119,8 +116,10 @@ submitSyslog(int pri, uchar *buf)
/* we have a timestamp */
DBGPRINTF("kernel timestamp is %ld %ld\n", secs, nsecs);
- bufsize= strlen((char*)buf);
- memmove(buf+3, buf+i, bufsize - i + 1);
+ if(!pModConf->bKeepKernelStamp) {
+ bufsize= strlen((char*)buf);
+ memmove(buf+3, buf+i, bufsize - i + 1);
+ }
clock_gettime(CLOCK_MONOTONIC, &monotonic);
clock_gettime(CLOCK_REALTIME, &realtime);
@@ -146,7 +145,7 @@ done:
}
#else /* now comes the BSD "code" (just a shim) */
static void
-submitSyslog(int pri, uchar *buf)
+submitSyslog(modConfData_t *pModConf, int pri, uchar *buf)
{
Syslog(pri, buf, NULL);
}
@@ -196,7 +195,7 @@ finalize_it:
/* Read kernel log while data are available, split into lines.
*/
static void
-readklog(void)
+readklog(modConfData_t *pModConf)
{
char *p, *q;
int len, i;
@@ -238,18 +237,18 @@ readklog(void)
for (p = (char*)pRcv; (q = strchr(p, '\n')) != NULL; p = q + 1) {
*q = '\0';
- submitSyslog(LOG_INFO, (uchar*) p);
+ submitSyslog(pModConf, LOG_INFO, (uchar*) p);
}
len = strlen(p);
if (len >= iMaxLine - 1) {
- submitSyslog(LOG_INFO, (uchar*)p);
+ submitSyslog(pModConf, LOG_INFO, (uchar*)p);
len = 0;
}
if(len > 0)
memmove(pRcv, p, len + 1);
}
if (len > 0)
- submitSyslog(LOG_INFO, pRcv);
+ submitSyslog(pModConf, LOG_INFO, pRcv);
if(pRcv != NULL && (size_t) iMaxLine >= sizeof(bufRcv) - 1)
free(pRcv);
@@ -278,10 +277,10 @@ rsRetVal klogAfterRun(modConfData_t *pModConf)
* "message pull" mechanism.
* rgerhards, 2008-04-09
*/
-rsRetVal klogLogKMsg(modConfData_t __attribute__((unused)) *pModConf)
+rsRetVal klogLogKMsg(modConfData_t *pModConf)
{
DEFiRet;
- readklog();
+ readklog(pModConf);
RETiRet;
}
diff --git a/plugins/imklog/imklog.c b/plugins/imklog/imklog.c
index 9332370..2897d76 100644
--- a/plugins/imklog/imklog.c
+++ b/plugins/imklog/imklog.c
@@ -91,6 +91,7 @@ static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config para
static struct cnfparamdescr modpdescr[] = {
{ "logpath", eCmdHdlrGetWord, 0 },
{ "permitnonkernelfacility", eCmdHdlrBinary, 0 },
+ { "keepkerneltimestamp", eCmdHdlrBinary, 0 },
{ "consoleloglevel", eCmdHdlrInt, 0 },
{ "internalmsgfacility", eCmdHdlrFacility, 0 }
};
@@ -289,6 +290,7 @@ CODESTARTbeginCnfLoad
pModConf->pszPath = NULL;
pModConf->bPermitNonKernel = 0;
pModConf->console_log_level = -1;
+ pModConf->bKeepKernelStamp = 0;
pModConf->iFacilIntMsg = klogFacilIntMsg();
loadModConf->configSetViaV2Method = 0;
bLegacyCnfModGlobalsPermitted = 1;
@@ -322,6 +324,8 @@ CODESTARTsetModCnf
loadModConf->bPermitNonKernel = (int) pvals[i].val.d.n;
} else if(!strcmp(modpblk.descr[i].name, "consoleloglevel")) {
loadModConf->console_log_level= (int) pvals[i].val.d.n;
+ } else if(!strcmp(modpblk.descr[i].name, "keepkerneltimestamp")) {
+ loadModConf->bKeepKernelStamp = (int) pvals[i].val.d.n;
} else if(!strcmp(modpblk.descr[i].name, "internalmsgfacility")) {
loadModConf->iFacilIntMsg = (int) pvals[i].val.d.n;
} else {
@@ -347,6 +351,7 @@ CODESTARTendCnfLoad
loadModConf->bPermitNonKernel = cs.bPermitNonKernel;
loadModConf->iFacilIntMsg = cs.iFacilIntMsg;
loadModConf->console_log_level = cs.console_log_level;
+ loadModConf->bKeepKernelStamp = 0;
if((cs.pszPath == NULL) || (cs.pszPath[0] == '\0')) {
loadModConf->pszPath = NULL;
if(cs.pszPath != NULL)
diff --git a/plugins/imklog/imklog.h b/plugins/imklog/imklog.h
index acfb50a..6cd97c3 100644
--- a/plugins/imklog/imklog.h
+++ b/plugins/imklog/imklog.h
@@ -36,6 +36,7 @@ struct modConfData_s {
uchar *pszPath;
int console_log_level;
sbool bPermitNonKernel;
+ sbool bKeepKernelStamp; /* keep kernel timestamp instead of interpreting it */
sbool configSetViaV2Method;
};
--
1.7.10.4
From 24e74d95c03bdf44f40ad41a4f6d4fabef0bca2c Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Wed, 21 Nov 2012 13:47:19 +0100
Subject: [PATCH 2/5] imklog: added paramter "parseKernelTimestamp"
When enabled, kernel message [timestamp] is converted for message time.
Default is to use receive time as in 5.8.x and before, because the clock
used to create the timestamp is not supposed to be as accurate as the
monotonic clock (depends on hardware and kernel) resulting in differences
between kernel and system messages which occurred at same time.
---
plugins/imklog/bsd.c | 3 +++
plugins/imklog/imklog.c | 5 +++++
plugins/imklog/imklog.h | 3 ++-
3 Dateien geändert, 10 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
diff --git a/plugins/imklog/bsd.c b/plugins/imklog/bsd.c
index ad194b5..0930d61 100644
--- a/plugins/imklog/bsd.c
+++ b/plugins/imklog/bsd.c
@@ -82,6 +82,9 @@ submitSyslog(modConfData_t *pModConf, int pri, uchar *buf)
struct timeval tv;
struct timeval *tp = NULL;
+ if(!pModConf->bParseKernelStamp)
+ goto done;
+
if(buf[3] != '[')
goto done;
DBGPRINTF("imklog: kernel timestamp detected, extracting it\n");
diff --git a/plugins/imklog/imklog.c b/plugins/imklog/imklog.c
index 2897d76..8471daa 100644
--- a/plugins/imklog/imklog.c
+++ b/plugins/imklog/imklog.c
@@ -91,6 +91,7 @@ static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config para
static struct cnfparamdescr modpdescr[] = {
{ "logpath", eCmdHdlrGetWord, 0 },
{ "permitnonkernelfacility", eCmdHdlrBinary, 0 },
+ { "parsekerneltimestamp", eCmdHdlrBinary, 0 },
{ "keepkerneltimestamp", eCmdHdlrBinary, 0 },
{ "consoleloglevel", eCmdHdlrInt, 0 },
{ "internalmsgfacility", eCmdHdlrFacility, 0 }
@@ -290,6 +291,7 @@ CODESTARTbeginCnfLoad
pModConf->pszPath = NULL;
pModConf->bPermitNonKernel = 0;
pModConf->console_log_level = -1;
+ pModConf->bParseKernelStamp = 0;
pModConf->bKeepKernelStamp = 0;
pModConf->iFacilIntMsg = klogFacilIntMsg();
loadModConf->configSetViaV2Method = 0;
@@ -324,6 +326,8 @@ CODESTARTsetModCnf
loadModConf->bPermitNonKernel = (int) pvals[i].val.d.n;
} else if(!strcmp(modpblk.descr[i].name, "consoleloglevel")) {
loadModConf->console_log_level= (int) pvals[i].val.d.n;
+ } else if(!strcmp(modpblk.descr[i].name, "parsekerneltimestamp")) {
+ loadModConf->bParseKernelStamp = (int) pvals[i].val.d.n;
} else if(!strcmp(modpblk.descr[i].name, "keepkerneltimestamp")) {
loadModConf->bKeepKernelStamp = (int) pvals[i].val.d.n;
} else if(!strcmp(modpblk.descr[i].name, "internalmsgfacility")) {
@@ -351,6 +355,7 @@ CODESTARTendCnfLoad
loadModConf->bPermitNonKernel = cs.bPermitNonKernel;
loadModConf->iFacilIntMsg = cs.iFacilIntMsg;
loadModConf->console_log_level = cs.console_log_level;
+ loadModConf->bParseKernelStamp = 0;
loadModConf->bKeepKernelStamp = 0;
if((cs.pszPath == NULL) || (cs.pszPath[0] == '\0')) {
loadModConf->pszPath = NULL;
diff --git a/plugins/imklog/imklog.h b/plugins/imklog/imklog.h
index 6cd97c3..6022f5e 100644
--- a/plugins/imklog/imklog.h
+++ b/plugins/imklog/imklog.h
@@ -36,7 +36,8 @@ struct modConfData_s {
uchar *pszPath;
int console_log_level;
sbool bPermitNonKernel;
- sbool bKeepKernelStamp; /* keep kernel timestamp instead of interpreting it */
+ sbool bParseKernelStamp; /* if try to parse kernel timestamps for message time */
+ sbool bKeepKernelStamp; /* keep the kernel timestamp in the message */
sbool configSetViaV2Method;
};
--
1.7.10.4
From 64bab984a1f7deece7c7b32b056c68b56b71ee77 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Wed, 21 Nov 2012 15:41:12 +0100
Subject: [PATCH 3/5] imklog: allow $klogParse- and KeepKernelTimestamp
---
plugins/imklog/imklog.c | 14 ++++++++++++--
1 Datei geändert, 12 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
diff --git a/plugins/imklog/imklog.c b/plugins/imklog/imklog.c
index 8471daa..0aec108 100644
--- a/plugins/imklog/imklog.c
+++ b/plugins/imklog/imklog.c
@@ -80,6 +80,8 @@ typedef struct configSettings_s {
int iFacilIntMsg; /* the facility to use for internal messages (set by driver) */
uchar *pszPath;
int console_log_level; /* still used for BSD */
+ int bParseKernelStamp;
+ int bKeepKernelStamp;
} configSettings_t;
static configSettings_t cs;
@@ -112,6 +114,8 @@ static inline void
initConfigSettings(void)
{
cs.bPermitNonKernel = 0;
+ cs.bParseKernelStamp = 0;
+ cs.bKeepKernelStamp = 0;
cs.console_log_level = -1;
cs.pszPath = NULL;
cs.iFacilIntMsg = klogFacilIntMsg();
@@ -355,8 +359,8 @@ CODESTARTendCnfLoad
loadModConf->bPermitNonKernel = cs.bPermitNonKernel;
loadModConf->iFacilIntMsg = cs.iFacilIntMsg;
loadModConf->console_log_level = cs.console_log_level;
- loadModConf->bParseKernelStamp = 0;
- loadModConf->bKeepKernelStamp = 0;
+ loadModConf->bParseKernelStamp = cs.bParseKernelStamp;;
+ loadModConf->bKeepKernelStamp = cs.bKeepKernelStamp;
if((cs.pszPath == NULL) || (cs.pszPath[0] == '\0')) {
loadModConf->pszPath = NULL;
if(cs.pszPath != NULL)
@@ -431,6 +435,8 @@ ENDqueryEtryPt
static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal)
{
cs.bPermitNonKernel = 0;
+ cs.bParseKernelStamp = 0;
+ cs.bKeepKernelStamp = 0;
if(cs.pszPath != NULL) {
free(cs.pszPath);
cs.pszPath = NULL;
@@ -468,6 +474,10 @@ CODEmodInit_QueryRegCFSLineHdlr
NULL, NULL, STD_LOADABLE_MODULE_ID));
CHKiRet(regCfSysLineHdlr2((uchar *)"klogpermitnonkernelfacility", 0, eCmdHdlrBinary,
NULL, &cs.bPermitNonKernel, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted));
+ CHKiRet(regCfSysLineHdlr2((uchar *)"klogparsekerneltimestamp", 0, eCmdHdlrBinary,
+ NULL, &cs.bParseKernelStamp, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted));
+ CHKiRet(regCfSysLineHdlr2((uchar *)"klogkeepkerneltimestamp", 0, eCmdHdlrBinary,
+ NULL, &cs.bKeepKernelStamp, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted));
CHKiRet(regCfSysLineHdlr2((uchar *)"klogconsoleloglevel", 0, eCmdHdlrInt,
NULL, &cs.console_log_level, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted));
CHKiRet(regCfSysLineHdlr2((uchar *)"kloginternalmsgfacility", 0, eCmdHdlrFacility,
--
1.7.10.4
From 3ce3f458f4ac088d3e650ad939500e72b35d1758 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Wed, 21 Nov 2012 13:47:44 +0100
Subject: [PATCH 4/5] imklog: convert to kmsg timestamp's us to ns first
---
plugins/imklog/bsd.c | 1 +
1 Datei geändert, 1 Zeile hinzugefügt(+)
diff --git a/plugins/imklog/bsd.c b/plugins/imklog/bsd.c
index 0930d61..2dc7527 100644
--- a/plugins/imklog/bsd.c
+++ b/plugins/imklog/bsd.c
@@ -111,6 +111,7 @@ submitSyslog(modConfData_t *pModConf, int pri, uchar *buf)
nsecs = nsecs * 10 + buf[i] - '0';
++i;
}
+ nsecs *= 1000; /* convert to ns first */
if(buf[i] != ']') {
DBGPRINTF("no trailing ']' --> no kernel timestamp\n");
goto done; /* no TS! */
--
1.7.10.4
From f8565e506fe01839035d40e12c2d13c1d15da45f Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Thu, 22 Nov 2012 15:05:52 +0100
Subject: [PATCH 5/5] imklog: added $klogParse/KeepKernelTimestamp docs
---
doc/imklog.html | 13 +++++++++++++
1 Datei geändert, 13 Zeilen hinzugefügt(+)
diff --git a/doc/imklog.html b/doc/imklog.html
index 6ccdb5b..294e2b7 100644
--- a/doc/imklog.html
+++ b/doc/imklog.html
@@ -65,6 +65,19 @@ Linux only, ignored on other platforms (but may be specified)</li>
former klogd -2 option<br>
Linux only, ignored on other platforms (but may be specified)<br style="font-weight: bold;">
</li>
+<li><b>$klogParseKernelTimestamp</b> [on/<b>off</b>]<br>
+If enabled and the kernel creates a timestamp for its log messages, this timestamp will be
+parsed and converted into regular message time instead to use the receive time of the kernel
+message (as in 5.8.x and before). Default is to not parse the kernel timestamp, because the
+clock used by the kernel to create the timestamps is not supposed to be as accurate as the
+monotonic clock required to convert it. Depending on the hardware and kernel, it can result
+in message time differences between kernel and system messages which occurred at same time.
+</li>
+<li><b>$klogKeepKernelTimestamp</b> [on/<b>off</b>]<br>
+If enabled, this option causes to keep the [timestamp] provided by the kernel at the begin
+of in each message rather than to remove it, when it could be parsed and converted into
+local time for use as regular message time. Only used, when $klogParseKernelTimestamp is on.
+</li>
</ul>
<b>Caveats/Known Bugs:</b>
<p>This is obviously platform specific and requires platform
--
1.7.10.4

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f9190acdf902a22338b4b0bc43e37cd863881068486f071cba907446c3e35b97
size 2701840

3
rsyslog-7.2.4.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:90af55f696db3209a9ef28d8e8052c48917479dd994838f5ef678b1f701c4540
size 2702981

View File

@ -1,3 +1,60 @@
-------------------------------------------------------------------
Wed Jan 9 14:05:53 UTC 2013 - mt@suse.com
- Enable rsyslog.service and create the syslog.service alias link
in post install -- regardless of a preset config (bnc#790805).
- Check the existence of /etc/init.d/syslog script before calling
the restart_on_update and stop_on_removal macros to avoid errors
on update. Since openSUSE 12.3, no syslog init script is shipped
(bnc#790298,bnc#750478).
-------------------------------------------------------------------
Mon Jan 7 10:58:19 UTC 2013 - mt@suse.com
- Update to 7.2.4 [v7-stable] with following changes:
- enhance: permit RFC3339 timestamp in local log socket messages
Thanks to Sebastien Ponce for the patch.
- imklog: added ParseKernelTimestamp parameter (import from 5.10.2)
Thanks to Marius Tomaschewski for the patch.
- fix missing functionality: ruleset(){} could not specify ruleset queue
The "queue.xxx" parameter set was not supported, and legacy ruleset
config statements did not work (by intention). The fix introduces the
"queue.xxx" parameter set. It has some regression potential, but only
for the new functionality. Note that using that interface it is possible
to specify duplicate queue file names, which will cause trouble. This
will be solved in v7.3, because there is a too-large regression
potential for the v7.2 stable branch.
- imklog: added KeepKernelTimestamp parameter (import from 5.10.2)
Thanks to Marius Tomaschewski for the patch.
- bugfix: imklog mistakenly took kernel timestamp subseconds as nanoseconds
... actually, they are microseconds. So the fractional part of the
timestamp was not properly formatted. (import from 5.10.2)
Thanks to Marius Tomaschewski for the bug report and the patch idea.
- bugfix: supportoctetcountedframing parameter did not work in imptcp
- bugfix: modules not (yet) supporting new conf format were not properly
registered. This lead to a "module not found" error message instead of
the to-be-expected "module does not support new style" error message.
That invalid error message could be quite misleading and actually stop
people from addressing the real problem (aka "go nuts" ;))
- bugfix: template "type" parameter is mandatory (but was not)
- bugfix: some message properties could be garbled due to race condition
This happened only on very high volume systems, if the same message was
being processed by two different actions. This was a regression caused
by the new config processor, which did no longer properly enable msg
locking in multithreaded cases. The bugfix is actually a refactoring of
the msg locking code - we no longer do unlocked operations, as the use
case for it has mostly gone away. It is potentially possible only at
very low-end systems, and there the small additional overhead of doing
the locking does not really hurt. Instead, the removal of that
capability can actually slightly improve performance in common cases,
as the code path is smaller and requires slightly less memory writes.
That probably outperforms the extra locking overhead (which in the
low-end case always happens in user space, without need for kernel
support as we can always directly aquire the lock - there is no
contention at all).
- Removed imklog-kernel-timestamp-parsing (bnc#783967) patch obsoleted
by this version.
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Nov 23 01:28:46 UTC 2012 - mrueckert@suse.de Fri Nov 23 01:28:46 UTC 2012 - mrueckert@suse.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package rsyslog # spec file for package rsyslog
# #
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2013 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
@ -20,7 +20,7 @@ Name: rsyslog
Summary: The enhanced syslogd for Linux and Unix Summary: The enhanced syslogd for Linux and Unix
License: (GPL-3.0+ and Apache-2.0) License: (GPL-3.0+ and Apache-2.0)
Group: System/Daemons Group: System/Daemons
Version: 7.2.3 Version: 7.2.4
Release: 0 Release: 0
%if 0%{?suse_version} >= 1210 %if 0%{?suse_version} >= 1210
%bcond_without systemd %bcond_without systemd
@ -150,7 +150,6 @@ Source2: rsyslog.conf.in
Source4: rsyslog.d.remote.conf.in Source4: rsyslog.d.remote.conf.in
Source5: rsyslog-service-prepare.in Source5: rsyslog-service-prepare.in
Source6: rsyslog.service.in.in Source6: rsyslog.service.in.in
Patch1: 0001-imklog-kernel-timestamp-parsing.bnc783967.patch
%description %description
Rsyslog is an enhanced multi-threaded syslogd supporting, among others, Rsyslog is an enhanced multi-threaded syslogd supporting, among others,
@ -357,7 +356,6 @@ This module provides support to output to an HDFS database.
%endif %endif
%if %{with mongodb} %if %{with mongodb}
%package module-mongodb %package module-mongodb
@ -373,7 +371,6 @@ This module provides support to output to a MongoDB database.
%endif %endif
%if %{with hiredis} %if %{with hiredis}
%package module-hiredis %package module-hiredis
@ -406,7 +403,6 @@ This module provides support for ZeroMQ.
%prep %prep
%setup -q -n %{name}-%{upstream_version} %setup -q -n %{name}-%{upstream_version}
%patch1 -p1
# #
%if %{with systemd} %if %{with systemd}
for file in rsyslog-service-prepare rsyslog.service.in ; do for file in rsyslog-service-prepare rsyslog.service.in ; do
@ -686,7 +682,13 @@ chmod 640 ".%{rsyslog_sockets_cfg}"
# Enable the rsyslogservice to be started by systemd # Enable the rsyslogservice to be started by systemd
# #
%if %{with systemd} && ! %{with systemv} %if %{with systemd} && ! %{with systemv}
# This macro enables based on a systemctl preset config file only
%{service_add_post rsyslog.service} %{service_add_post rsyslog.service}
# But we want to enable a syslog-daemon regardless of the preset;
# force the creation of a syslog.service alias link (bnc#790805).
# We do not check the obsolete SYSLOG_DAEMON variable as we want
# to switch when installing it and there is a provider conflict.
/usr/bin/systemctl -f enable rsyslog.service >/dev/null 2>&1 || :
%endif %endif
%preun %preun
@ -696,7 +698,9 @@ chmod 640 ".%{rsyslog_sockets_cfg}"
%if %{with systemd} && ! %{with systemv} %if %{with systemd} && ! %{with systemv}
%{service_del_preun rsyslog.service} %{service_del_preun rsyslog.service}
%else %else
%{stop_on_removal syslog} if test -x /etc/init.d/syslog ; then
%{stop_on_removal syslog}
fi
# #
# reset SYSLOG_DAEMON variable on removal # reset SYSLOG_DAEMON variable on removal
# #
@ -721,7 +725,9 @@ fi
# #
# stop the rsyslogd daemon when it is running # stop the rsyslogd daemon when it is running
# #
%{restart_on_update syslog} if test -x /etc/init.d/syslog ; then
%{restart_on_update syslog}
fi
# #
# cleanup init scripts # cleanup init scripts
# #