Marius Tomaschewski
3d1ee4b9dc
- 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 OBS-URL: https://build.opensuse.org/package/show/Base:System/rsyslog?expand=0&rev=120
908 lines
22 KiB
RPMSpec
908 lines
22 KiB
RPMSpec
#
|
|
# spec file for package rsyslog
|
|
#
|
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
Name: rsyslog
|
|
Summary: The enhanced syslogd for Linux and Unix
|
|
License: (GPL-3.0+ and Apache-2.0)
|
|
Group: System/Daemons
|
|
Version: 7.2.4
|
|
Release: 0
|
|
%if 0%{?suse_version} >= 1210
|
|
%bcond_without systemd
|
|
%bcond_without udpspoof
|
|
%bcond_without dbi
|
|
%else
|
|
%bcond_with systemd
|
|
%bcond_with udpspoof
|
|
%bcond_with dbi
|
|
%endif
|
|
%if 0%{?suse_version} >= 1230
|
|
%bcond_with systemv
|
|
%else
|
|
%bcond_without systemv
|
|
%endif
|
|
%bcond_without gssapi
|
|
%bcond_without gnutls
|
|
%bcond_without mysql
|
|
%bcond_without pgsql
|
|
%bcond_without relp
|
|
%bcond_without snmp
|
|
%bcond_without diagtools
|
|
%bcond_without mmnormalize
|
|
%bcond_without elasticsearch
|
|
# TODO: ... doesnt have a proper configure check but wants hdfs.h
|
|
%bcond_with hdfs
|
|
%bcond_with mongodb
|
|
%bcond_with hiredis
|
|
%bcond_with zeromq
|
|
%define upstream_version %{version}
|
|
%define rsyslogdocdir %{_docdir}/%{name}
|
|
%define rsyslog_rundir %{_localstatedir}/run/rsyslog
|
|
%define rsyslog_sockets_cfg %{rsyslog_rundir}/additional-log-sockets.conf
|
|
%define rsyslog_module_dir_nodeps %{_libdir}/rsyslog/
|
|
%define rsyslog_module_dir_withdeps %{_libdir}/rsyslog/
|
|
Url: http://www.rsyslog.com/
|
|
%if %{with systemd}
|
|
Provides: syslog
|
|
Provides: sysvinit(syslog)
|
|
Conflicts: otherproviders(syslog)
|
|
Requires(pre): %fillup_prereq
|
|
%if %{with systemv}
|
|
Requires(pre): %insserv_prereq
|
|
Requires(pre): syslog-service < 2.0
|
|
Requires(pre): /etc/init.d/syslog
|
|
%else
|
|
Requires(pre): syslog-service >= 2.0
|
|
%endif
|
|
%{?systemd_requires}
|
|
BuildRequires: pkgconfig(systemd)
|
|
%else
|
|
Requires(pre): %insserv_prereq %fillup_prereq /etc/init.d/syslog
|
|
BuildRequires: klogd
|
|
%endif
|
|
BuildRequires: dos2unix
|
|
BuildRequires: openssl-devel
|
|
BuildRequires: pcre-devel
|
|
BuildRequires: pkgconfig
|
|
BuildRequires: zlib-devel
|
|
%if %{with elasticsearch}
|
|
BuildRequires: curl-devel
|
|
%endif
|
|
%if %{with hiredis}
|
|
BuildRequires: hiredis-devel >= 0.10.1
|
|
%endif
|
|
%if %{with mongodb}
|
|
# TODO: PKG_CHECK_MODULES(LIBMONGO_CLIENT, libmongo-client >= 0.1.4)
|
|
%endif
|
|
%if %{with zeromq}
|
|
BuildRequires: czmq-devel >= 1.1.0
|
|
%endif
|
|
%if %{with gssapi}
|
|
BuildRequires: krb5-devel
|
|
%endif
|
|
%if %{with gnutls}
|
|
BuildRequires: libgcrypt-devel
|
|
BuildRequires: libgnutls-devel
|
|
%endif
|
|
%if %{with dbi}
|
|
BuildRequires: libdbi-devel
|
|
%endif
|
|
%if %{with mysql}
|
|
BuildRequires: mysql-devel
|
|
%endif
|
|
%if %{with snmp}
|
|
BuildRequires: net-snmp-devel
|
|
%endif
|
|
%if %{with pgsql}
|
|
BuildRequires: postgresql-devel
|
|
%endif
|
|
%if %{with relp}
|
|
# RELP support
|
|
BuildRequires: librelp-devel
|
|
%endif
|
|
%if %{with udpspoof}
|
|
# UDP spoof support
|
|
BuildRequires: libnet-devel
|
|
%endif
|
|
%if %{with mmnormalize}
|
|
# mmnormalize support
|
|
BuildRequires: liblognorm-devel
|
|
%endif
|
|
# mmjsonparse needs liblognorm,
|
|
# but json check is unconditional
|
|
%if 0%{?suse_version} >= 1210
|
|
BuildRequires: pkgconfig(json) >= 0.9
|
|
BuildRequires: pkgconfig(libee) >= 0.4.0
|
|
BuildRequires: pkgconfig(libestr) >= 0.1.2
|
|
%else
|
|
BuildRequires: libee-devel
|
|
BuildRequires: libestr-devel
|
|
BuildRequires: libjson-devel
|
|
%endif
|
|
%if 0%{?suse_version} >= 1220
|
|
BuildRequires: pkgconfig(uuid) >= 2.21.0
|
|
%else
|
|
BuildRequires: libuuid-devel
|
|
%endif
|
|
%if %{with systemd}
|
|
%{?systemd_requires}
|
|
BuildRequires: pkgconfig(systemd)
|
|
%endif
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
Source0: http://www.rsyslog.com/files/download/%{name}/%{name}-%{upstream_version}.tar.gz
|
|
Source1: rsyslog.sysconfig
|
|
Source2: rsyslog.conf.in
|
|
Source4: rsyslog.d.remote.conf.in
|
|
Source5: rsyslog-service-prepare.in
|
|
Source6: rsyslog.service.in.in
|
|
|
|
%description
|
|
Rsyslog is an enhanced multi-threaded syslogd supporting, among others,
|
|
MySQL, syslog/tcp, RFC 3195, permitted sender lists, filtering on any
|
|
message part, and fine grain output format control. It is quite
|
|
compatible to stock sysklogd and can be used as a drop-in replacement.
|
|
Its advanced features make it suitable for enterprise-class, encryption
|
|
protected syslog relay chains while at the same time being very easy to
|
|
setup for the novice user.
|
|
|
|
%package doc
|
|
Requires: %{name} = %{version}
|
|
Summary: Additional documentation for rsyslog
|
|
Group: System/Daemons
|
|
|
|
%description doc
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This package provides additional documentation for rsyslog.
|
|
|
|
%if %{with diagtools}
|
|
|
|
%package diag-tools
|
|
Requires: %{name} = %{version}
|
|
Summary: Diagnostic tools
|
|
Group: System/Daemons
|
|
|
|
%description diag-tools
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This package provides additional diagnostic tools (small helpers,
|
|
usually not needed).
|
|
|
|
%endif
|
|
|
|
%if %{with gssapi}
|
|
|
|
%package module-gssapi
|
|
Requires: %{name} = %{version}
|
|
Summary: GSS-API support module for rsyslog
|
|
Group: System/Daemons
|
|
|
|
%description module-gssapi
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides the support to receive syslog messages from the
|
|
network protected via Kerberos 5 encryption and authentication.
|
|
|
|
%endif
|
|
|
|
%if %{with mysql}
|
|
|
|
%package module-mysql
|
|
Requires: %{name} = %{version}
|
|
Summary: MySQL support module for rsyslog
|
|
Group: System/Daemons
|
|
|
|
%description module-mysql
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This package provides a module with the support for logging into MySQL
|
|
databases.
|
|
|
|
%endif
|
|
|
|
%if %{with pgsql}
|
|
|
|
%package module-pgsql
|
|
Requires: %{name} = %{version}
|
|
Summary: PostgreSQL support module for rsyslog
|
|
Group: System/Daemons
|
|
|
|
%description module-pgsql
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides the support for logging into PostgreSQL databases.
|
|
|
|
%endif
|
|
|
|
%if %{with dbi}
|
|
|
|
%package module-dbi
|
|
Requires: %{name} = %{version}
|
|
Summary: Database support via DBI
|
|
Group: System/Daemons
|
|
|
|
%description module-dbi
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This package provides a module with the support for logging into DBI
|
|
supported databases.
|
|
|
|
%endif
|
|
|
|
%if %{with snmp}
|
|
|
|
%package module-snmp
|
|
Requires: %{name} = %{version}
|
|
Summary: SNMP support module for rsyslog
|
|
Group: System/Daemons
|
|
|
|
%description module-snmp
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides the ability to send syslog messages as an SNMPv1 &
|
|
v2c traps.
|
|
|
|
%endif
|
|
|
|
%if %{with gnutls}
|
|
|
|
%package module-gtls
|
|
Requires: %{name} = %{version}
|
|
Summary: TLS encryption support module for rsyslog
|
|
Group: System/Daemons
|
|
|
|
%description module-gtls
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides the ability for TLS encrypted TCP logging (based
|
|
on current syslog-transport-tls internet drafts).
|
|
%endif
|
|
|
|
%if %{with relp}
|
|
|
|
%package module-relp
|
|
Requires: %{name} = %{version}
|
|
Summary: RELP protocol support module for syslog
|
|
Group: System/Daemons
|
|
|
|
%description module-relp
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides Reliable Event Logging Protocol support.
|
|
|
|
%endif
|
|
|
|
%if %{with mmnormalize}
|
|
|
|
%package module-mmnormalize
|
|
Requires: %{name} = %{version}
|
|
Summary: Contains the mmnormalize support module for syslog
|
|
Group: System/Daemons
|
|
|
|
%description module-mmnormalize
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides log normalizing support.
|
|
|
|
%endif
|
|
|
|
%if %{with udpspoof}
|
|
|
|
%package module-udpspoof
|
|
Requires: %{name} = %{version}
|
|
Summary: UDP spoof support module for syslog
|
|
Group: System/Daemons
|
|
|
|
%description module-udpspoof
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides a UDP forwarder that allows changing the sender address.
|
|
|
|
%endif
|
|
|
|
%if %{with elasticsearch}
|
|
|
|
%package module-elasticsearch
|
|
Requires: %{name} = %{version}
|
|
Summary: ElasticSearch output module for syslog
|
|
Group: System/Daemons
|
|
|
|
%description module-elasticsearch
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides support to output to an ElasticSearch database.
|
|
|
|
%endif
|
|
|
|
%if %{with hdfs}
|
|
|
|
%package module-hdfs
|
|
Requires: %{name} = %{version}
|
|
Summary: HDFS output module for syslog
|
|
Group: System/Daemons
|
|
|
|
%description module-hdfs
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides support to output to an HDFS database.
|
|
|
|
%endif
|
|
|
|
%if %{with mongodb}
|
|
|
|
%package module-mongodb
|
|
Requires: %{name} = %{version}
|
|
Summary: MongoDB output module for syslog
|
|
Group: System/Daemons
|
|
|
|
%description module-mongodb
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides support to output to a MongoDB database.
|
|
|
|
%endif
|
|
|
|
%if %{with hiredis}
|
|
|
|
%package module-hiredis
|
|
Requires: %{name} = %{version}
|
|
Summary: Redis output module for syslog
|
|
Group: System/Daemons
|
|
|
|
%description module-hiredis
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides support to output to a Redis database.
|
|
|
|
%endif
|
|
|
|
%if %{with zeromq}
|
|
|
|
%package module-zeromq
|
|
Requires: %{name} = %{version}
|
|
Summary: ZeroMQ support module for syslog
|
|
Group: System/Daemons
|
|
|
|
%description module-zeromq
|
|
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
|
|
package.
|
|
|
|
This module provides support for ZeroMQ.
|
|
|
|
%endif
|
|
|
|
%prep
|
|
%setup -q -n %{name}-%{upstream_version}
|
|
#
|
|
%if %{with systemd}
|
|
for file in rsyslog-service-prepare rsyslog.service.in ; do
|
|
sed \
|
|
-e 's;RUN_DIR;%{rsyslog_rundir};g' \
|
|
-e 's;ADDITIONAL_SOCKETS;%{rsyslog_sockets_cfg};g' \
|
|
"%{_sourcedir}/${file}.in" > "${file}"
|
|
done
|
|
%endif
|
|
dos2unix doc/*.html
|
|
|
|
%build
|
|
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -W -Wall -I../grammar -I../../grammar"
|
|
# needs liblogging
|
|
# --enable-rfc3195 \
|
|
# needs java
|
|
# --enable-gui \
|
|
%configure \
|
|
--with-moddirs=%{rsyslog_module_dir_withdeps} \
|
|
--enable-option-checking \
|
|
--enable-largefile \
|
|
--enable-pthreads \
|
|
--enable-regexp \
|
|
--enable-zlib \
|
|
--enable-klog \
|
|
--enable-kmsg \
|
|
--enable-inet \
|
|
--enable-unlimited-select \
|
|
--enable-rsyslogd \
|
|
%if %{with elasticsearch}
|
|
--enable-elasticsearch \
|
|
%endif
|
|
%if %{with gnutls}
|
|
--enable-gnutls \
|
|
%endif
|
|
%if %{with gssapi}
|
|
--enable-gssapi-krb5 \
|
|
%endif
|
|
%if %{with dbi}
|
|
--enable-libdbi \
|
|
%endif
|
|
%if %{with mysql}
|
|
--enable-mysql \
|
|
%endif
|
|
%if %{with pgsql}
|
|
--enable-pgsql \
|
|
%endif
|
|
%if %{with relp}
|
|
--enable-relp \
|
|
%endif
|
|
%if %{with snmp}
|
|
--enable-snmp \
|
|
--enable-mmsnmptrapd \
|
|
%endif
|
|
--enable-mail \
|
|
--enable-imfile \
|
|
--enable-imptcp \
|
|
--enable-imttcp \
|
|
--enable-impstats \
|
|
--enable-omprog \
|
|
--enable-omuxsock \
|
|
%if %{with udpspoof}
|
|
--enable-omudpspoof \
|
|
%endif
|
|
--enable-omstdout \
|
|
--enable-pmlastmsg \
|
|
--enable-pmcisconames \
|
|
--enable-pmaixforwardedfrom \
|
|
--enable-pmsnare \
|
|
--enable-pmrfc3164sd \
|
|
--enable-omruleset \
|
|
%if %{with mmnormalize}
|
|
--enable-mmnormalize \
|
|
--enable-mmjsonparse \
|
|
--enable-mmaudit \
|
|
%endif
|
|
%if %{with hdfs}
|
|
--enable-omhdfs \
|
|
%endif
|
|
%if %{with mongodb}
|
|
--enable-ommongodb \
|
|
%endif
|
|
%if %{with hiredis}
|
|
--enable-omhiredis \
|
|
%endif
|
|
%if %{with zeromq}
|
|
--enable-imzmq3 \
|
|
--enable-omzmq3 \
|
|
%endif
|
|
%if %{with diagtools}
|
|
--enable-imdiag \
|
|
--enable-diagtools \
|
|
%endif
|
|
--disable-static
|
|
|
|
make %{?_smp_mflags:%{_smp_mflags}} V=1
|
|
|
|
%install
|
|
make install DESTDIR="%{buildroot}" V=1
|
|
#
|
|
rm -f %{buildroot}%{rsyslog_module_dir_nodeps}/*.la
|
|
#
|
|
# move all modules linking libraries in /usr to /usr/lib[64]
|
|
# the user has to specify them with full path then...
|
|
install -d -m0755 %{buildroot}%{rsyslog_module_dir_withdeps}
|
|
if test "%{rsyslog_module_dir_nodeps}" != "%{rsyslog_module_dir_withdeps}" ; then
|
|
for mod in \
|
|
%if %{with gnutls}
|
|
lmnsd_gtls.so \
|
|
%endif
|
|
%if %{with gssapi}
|
|
omgssapi.so imgssapi.so lmgssutil.so \
|
|
%endif
|
|
%if %{with dbi}
|
|
omlibdbi.so \
|
|
%endif
|
|
%if %{with mysql}
|
|
ommysql.so \
|
|
%endif
|
|
%if %{with pgsql}
|
|
ompgsql.so \
|
|
%endif
|
|
%if %{with relp}
|
|
imrelp.so omrelp.so \
|
|
%endif
|
|
%if %{with snmp}
|
|
omsnmp.so \
|
|
%endif
|
|
%if %{with mmnormalize}
|
|
mmnormalize.so \
|
|
mmjsonparse.so \
|
|
mmaudit.so \
|
|
%endif
|
|
%if %{with elasticsearch}
|
|
omelasticsearch.so \
|
|
%endif
|
|
; do
|
|
mv -f %{buildroot}%{rsyslog_module_dir_nodeps}/$mod \
|
|
%{buildroot}%{rsyslog_module_dir_withdeps}
|
|
done
|
|
fi
|
|
if test "%{_sbindir}" != "/sbin" ; then
|
|
install -d -m0755 %{buildroot}/sbin
|
|
ln -sf %{_sbindir}/rsyslogd $RPM_BUILD_ROOT/sbin/rsyslogd
|
|
fi
|
|
#
|
|
%if %{with systemd} && ! %{with systemv}
|
|
install -m755 rsyslog-service-prepare %{buildroot}%{_sbindir}/
|
|
%else
|
|
if test -e %{buildroot}%{_unitdir}/rsyslog.service ; then
|
|
rm -f %{buildroot}%{_unitdir}/rsyslog.service
|
|
fi
|
|
%endif
|
|
#
|
|
install -d -m0755 %{buildroot}%{_sysconfdir}/rsyslog.d
|
|
install -d -m0755 %{buildroot}%{_localstatedir}/run/rsyslog
|
|
install -d -m0755 %{buildroot}%{_localstatedir}/spool/rsyslog
|
|
for file in rsyslog.conf rsyslog.d.remote.conf ; do
|
|
sed \
|
|
%ifarch s390 s390x
|
|
-e 's;tty10;console;g' \
|
|
%endif
|
|
-e 's;ADDITIONAL_SOCKETS;%{rsyslog_sockets_cfg};g' \
|
|
-e 's;ETC_RSYSLOG_CONF;%{_sysconfdir}/rsyslog.conf;g' \
|
|
-e 's;ETC_RSYSLOG_D_DIR;%{_sysconfdir}/rsyslog.d;g' \
|
|
-e 's;ETC_RSYSLOG_D_GLOB;%{_sysconfdir}/rsyslog.d/*.conf;g' \
|
|
-e 's;RSYSLOG_SPOOL_DIR;%{_localstatedir}/spool/rsyslog;g' \
|
|
%{_sourcedir}/${file}.in > ${file}.$$
|
|
done
|
|
install -m0600 rsyslog.conf.$$ \
|
|
%{buildroot}%{_sysconfdir}/rsyslog.conf
|
|
install -m0600 rsyslog.d.remote.conf.$$ \
|
|
%{buildroot}%{_sysconfdir}/rsyslog.d/remote.conf
|
|
#
|
|
install -d -m0755 %{buildroot}/var/adm/fillup-templates
|
|
install -m0600 %{_sourcedir}/rsyslog.sysconfig \
|
|
%{buildroot}/var/adm/fillup-templates/sysconfig.syslog-rsyslog
|
|
#
|
|
rm -f doc/Makefile*
|
|
install -d -m0755 %{buildroot}%{rsyslogdocdir}/
|
|
find ChangeLog README AUTHORS COPYING COPYING.LESSER rsyslog.conf doc \
|
|
\( -type d -exec install -m755 -d %{buildroot}%{rsyslogdocdir}/\{\} \; \) \
|
|
-o \( -type f -exec install -m644 \{\} %{buildroot}%{rsyslogdocdir}/\{\} \; \)
|
|
#
|
|
%if %{with mysql}
|
|
install -m644 plugins/ommysql/createDB.sql \
|
|
%{buildroot}%{rsyslogdocdir}/mysql-createDB.sql
|
|
%endif
|
|
%if %{with pgsql}
|
|
install -m644 plugins/ompgsql/createDB.sql \
|
|
%{buildroot}%{rsyslogdocdir}/pgsql-createDB.sql
|
|
%endif
|
|
# create ghosts
|
|
install -d -m0755 %{buildroot}%{rsyslog_rundir}
|
|
touch %{buildroot}%{rsyslog_sockets_cfg}
|
|
chmod 644 %{buildroot}%{rsyslog_sockets_cfg}
|
|
|
|
%clean
|
|
if [ -n "%{buildroot}" ] && [ "%{buildroot}" != "/" ] ; then
|
|
rm -rf "%{buildroot}"
|
|
fi
|
|
|
|
%if %{with systemd} && ! %{with systemv}
|
|
|
|
%pre
|
|
%{service_add_pre rsyslog.service}
|
|
|
|
%endif
|
|
|
|
%post
|
|
#
|
|
# update linker caches
|
|
#
|
|
/sbin/ldconfig
|
|
#
|
|
# remove obsolete variables
|
|
#
|
|
%{remove_and_set -n syslog SYSLOG_DAEMON SYSLOG_REQUIRES_NETWORK}
|
|
%{remove_and_set -n syslog RSYSLOGD_COMPAT_VERSION RSYSLOGD_NATIVE_VERSION}
|
|
%if %{with systemv}
|
|
%{fillup_and_insserv -ny syslog syslog}
|
|
%endif
|
|
#
|
|
# add RSYSLOGD_* variables
|
|
#
|
|
%{fillup_only -ns syslog rsyslog}
|
|
%if %{with systemv}
|
|
#
|
|
# switch SYSLOG_DAEMON to outself
|
|
#
|
|
if test -f etc/sysconfig/syslog ; then
|
|
sed -i \
|
|
-e 's/^SYSLOG_DAEMON=.*/SYSLOG_DAEMON="rsyslogd"/g' \
|
|
etc/sysconfig/syslog
|
|
fi
|
|
%endif
|
|
#
|
|
# Do not use multiple facilities with the same priority pattern.
|
|
# It causes start failure since rsyslog-6.4.x (bnc#780607).
|
|
#
|
|
# FIXME: it seems to be a valid syntax -> rsyslog bug?
|
|
#
|
|
if grep -qs '^local[0246],' etc/rsyslog.conf ; then
|
|
sed -i -e 's/^local\([0246]\),/local\1.*;/g' etc/rsyslog.conf
|
|
fi
|
|
#
|
|
# create dirs, touch log default files
|
|
#
|
|
mkdir -p var/log
|
|
touch var/log/messages; chmod 640 var/log/messages
|
|
touch var/log/mail; chmod 640 var/log/mail
|
|
touch var/log/mail.info; chmod 640 var/log/mail.info
|
|
touch var/log/mail.warn; chmod 640 var/log/mail.warn
|
|
touch var/log/mail.err; chmod 640 var/log/mail.err
|
|
test -f var/log/news && mv -f var/log/news var/log/news.bak
|
|
mkdir -p -m 0750 var/log/news
|
|
chown news:news var/log/news
|
|
touch var/log/news/news.crit; chmod 640 var/log/news/news.crit
|
|
chown news:news var/log/news/news.crit
|
|
touch var/log/news/news.err; chmod 640 var/log/news/news.err
|
|
chown news:news var/log/news/news.err
|
|
touch var/log/news/news.notice; chmod 640 var/log/news/news.notice
|
|
chown news:news var/log/news/news.notice
|
|
#
|
|
# touch the additional log files we are using
|
|
#
|
|
touch var/log/acpid; chmod 640 var/log/acpid
|
|
touch var/log/firewall; chmod 640 var/log/firewall
|
|
touch var/log/NetworkManager; chmod 640 var/log/NetworkManager
|
|
#
|
|
# touch the additional log sockets config file
|
|
#
|
|
mkdir -p -m750 ".%{rsyslog_rundir}"
|
|
touch ".%{rsyslog_sockets_cfg}"
|
|
chmod 640 ".%{rsyslog_sockets_cfg}"
|
|
#
|
|
# Enable the rsyslogservice to be started by systemd
|
|
#
|
|
%if %{with systemd} && ! %{with systemv}
|
|
%{service_add_post rsyslog.service}
|
|
%endif
|
|
|
|
%preun
|
|
#
|
|
# stop the rsyslogd daemon when it is running
|
|
#
|
|
%if %{with systemd} && ! %{with systemv}
|
|
%{service_del_preun rsyslog.service}
|
|
%else
|
|
%{stop_on_removal syslog}
|
|
#
|
|
# reset SYSLOG_DAEMON variable on removal
|
|
#
|
|
if test "$1" = "0" -a -f etc/sysconfig/syslog ; then
|
|
sed -i \
|
|
-e 's/^SYSLOG_DAEMON=.*/SYSLOG_DAEMON=""/g' \
|
|
etc/sysconfig/syslog
|
|
fi
|
|
%endif
|
|
|
|
%postun
|
|
#
|
|
# update linker caches
|
|
#
|
|
/sbin/ldconfig
|
|
%if %{with systemd} && ! %{with systemv}
|
|
#
|
|
# cleanup init scripts
|
|
#
|
|
%{service_del_postun rsyslog.service}
|
|
%else
|
|
#
|
|
# stop the rsyslogd daemon when it is running
|
|
#
|
|
%{restart_on_update syslog}
|
|
#
|
|
# cleanup init scripts
|
|
#
|
|
%{insserv_cleanup}
|
|
%endif
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%dir %{_sysconfdir}/rsyslog.d
|
|
%config(noreplace) %attr(600,root,root) %{_sysconfdir}/rsyslog.conf
|
|
%config(noreplace) %attr(600,root,root) %{_sysconfdir}/rsyslog.d/remote.conf
|
|
%{_sbindir}/rsyslogd
|
|
%if "%{_sbindir}" != "/sbin"
|
|
/sbin/rsyslogd
|
|
%endif
|
|
%dir %{rsyslog_module_dir_nodeps}
|
|
%{rsyslog_module_dir_nodeps}/imfile.so
|
|
%{rsyslog_module_dir_nodeps}/imklog.so
|
|
%{rsyslog_module_dir_nodeps}/imkmsg.so
|
|
%{rsyslog_module_dir_nodeps}/immark.so
|
|
%{rsyslog_module_dir_nodeps}/imtcp.so
|
|
%{rsyslog_module_dir_nodeps}/imttcp.so
|
|
%{rsyslog_module_dir_nodeps}/imudp.so
|
|
%{rsyslog_module_dir_nodeps}/imuxsock.so
|
|
%{rsyslog_module_dir_nodeps}/lmnet.so
|
|
%{rsyslog_module_dir_nodeps}/lmnetstrms.so
|
|
%{rsyslog_module_dir_nodeps}/lmnsd_ptcp.so
|
|
%{rsyslog_module_dir_nodeps}/imptcp.so
|
|
%{rsyslog_module_dir_nodeps}/lmregexp.so
|
|
%{rsyslog_module_dir_nodeps}/lmstrmsrv.so
|
|
%{rsyslog_module_dir_nodeps}/lmtcpclt.so
|
|
%{rsyslog_module_dir_nodeps}/lmtcpsrv.so
|
|
%{rsyslog_module_dir_nodeps}/lmzlibw.so
|
|
%{rsyslog_module_dir_nodeps}/ommail.so
|
|
%{rsyslog_module_dir_nodeps}/omprog.so
|
|
%{rsyslog_module_dir_nodeps}/omruleset.so
|
|
%{rsyslog_module_dir_nodeps}/omstdout.so
|
|
%{rsyslog_module_dir_nodeps}/omtesting.so
|
|
%{rsyslog_module_dir_nodeps}/omuxsock.so
|
|
%{rsyslog_module_dir_nodeps}/pmlastmsg.so
|
|
%{rsyslog_module_dir_nodeps}/impstats.so
|
|
%{rsyslog_module_dir_nodeps}/pmaixforwardedfrom.so
|
|
%{rsyslog_module_dir_nodeps}/pmcisconames.so
|
|
%{rsyslog_module_dir_nodeps}/pmrfc3164sd.so
|
|
%{rsyslog_module_dir_nodeps}/pmsnare.so
|
|
%dir %{rsyslog_module_dir_withdeps}
|
|
%{_mandir}/man5/rsyslog.conf.5*
|
|
%{_mandir}/man8/rsyslogd.8*
|
|
%dir %{rsyslogdocdir}
|
|
%doc %{rsyslogdocdir}/rsyslog.conf
|
|
%doc %{rsyslogdocdir}/ChangeLog
|
|
%doc %{rsyslogdocdir}/README
|
|
%doc %{rsyslogdocdir}/AUTHORS
|
|
%doc %{rsyslogdocdir}/COPYING
|
|
%doc %{rsyslogdocdir}/COPYING.LESSER
|
|
%dir %{_localstatedir}/spool/rsyslog
|
|
/var/adm/fillup-templates/sysconfig.syslog-rsyslog
|
|
%attr(0755,root,root) %dir %ghost %{rsyslog_rundir}
|
|
%attr(0644,root,root) %ghost %{rsyslog_sockets_cfg}
|
|
%if %{with systemd} && ! %{with systemv}
|
|
%{_sbindir}/rsyslog-service-prepare
|
|
%{_unitdir}/rsyslog.service
|
|
%endif
|
|
|
|
%files doc
|
|
%defattr(-,root,root)
|
|
%dir %{rsyslogdocdir}
|
|
%doc %{rsyslogdocdir}/doc
|
|
|
|
%if %{with diagtools}
|
|
|
|
%files diag-tools
|
|
%defattr(-,root,root)
|
|
%{_sbindir}/msggen
|
|
%{_sbindir}/rsyslog_diag_hostname
|
|
%{_sbindir}/zpipe
|
|
%{rsyslog_module_dir_nodeps}/imdiag.so
|
|
%endif
|
|
|
|
%if %{with gssapi}
|
|
|
|
%files module-gssapi
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_withdeps}/omgssapi.so
|
|
%{rsyslog_module_dir_withdeps}/imgssapi.so
|
|
%{rsyslog_module_dir_withdeps}/lmgssutil.so
|
|
%endif
|
|
|
|
%if %{with mysql}
|
|
|
|
%files module-mysql
|
|
%defattr(-,root,root)
|
|
%doc %{rsyslogdocdir}/mysql-createDB.sql
|
|
%{rsyslog_module_dir_withdeps}/ommysql.so
|
|
%endif
|
|
|
|
%if %{with pgsql}
|
|
|
|
%files module-pgsql
|
|
%defattr(-,root,root)
|
|
%doc %{rsyslogdocdir}/pgsql-createDB.sql
|
|
%{rsyslog_module_dir_withdeps}/ompgsql.so
|
|
%endif
|
|
|
|
%if %{with dbi}
|
|
|
|
%files module-dbi
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_withdeps}/omlibdbi.so
|
|
%endif
|
|
|
|
%if %{with snmp}
|
|
|
|
%files module-snmp
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_withdeps}/omsnmp.so
|
|
%{rsyslog_module_dir_nodeps}/mmsnmptrapd.so
|
|
%endif
|
|
|
|
%if %{with gnutls}
|
|
|
|
%files module-gtls
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_withdeps}/lmnsd_gtls.so
|
|
%endif
|
|
|
|
%if %{with relp}
|
|
|
|
%files module-relp
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_withdeps}/imrelp.so
|
|
%{rsyslog_module_dir_withdeps}/omrelp.so
|
|
%endif
|
|
|
|
%if %{with mmnormalize}
|
|
|
|
%files module-mmnormalize
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_withdeps}/mmnormalize.so
|
|
%{rsyslog_module_dir_withdeps}/mmjsonparse.so
|
|
%{rsyslog_module_dir_withdeps}/mmaudit.so
|
|
%endif
|
|
|
|
%if %{with udpspoof}
|
|
|
|
%files module-udpspoof
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_nodeps}/omudpspoof.so
|
|
%endif
|
|
|
|
%if %{with elasticsearch}
|
|
|
|
%files module-elasticsearch
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_withdeps}/omelasticsearch.so
|
|
%endif
|
|
|
|
%if %{with hdfs}
|
|
|
|
%files module-hdfs
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_withdeps}/omhdfs.so
|
|
%endif
|
|
|
|
%if %{with mongodb}
|
|
|
|
%files module-mongodb
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_withdeps}/ommongodb.so
|
|
%endif
|
|
|
|
%if %{with hiredis}
|
|
|
|
%files module-hiredis
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_withdeps}/omhiredis.so
|
|
%endif
|
|
|
|
%if %{with zeromq}
|
|
|
|
%files module-zeromq
|
|
%defattr(-,root,root)
|
|
%{rsyslog_module_dir_withdeps}/imzmq3.so
|
|
%{rsyslog_module_dir_withdeps}/omzmq3.so
|
|
%endif
|
|
|
|
%changelog
|