rsyslog: use update-alternatives and PACKAGECONFIG and two fixes
cover rsyslog: use update-alternatives and PACKAGECONFIG and two fixes
From: Jackie Huang <[email protected]>
---
The following changes since commit 5ccedeb028c46a6b98335fedb16029c6f7f87022:
sshfs-fuse: update to 2.5 (2014-04-20 16:10:21 +0200)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib jhuang0/r_rsyslog_noptest-2
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jhuang0/r_rsyslog_noptest-2
Jackie Huang (4):
rsyslog: use BPN to fix multilib and add all licenses
rsyslog: add PACKAGECONFIG for optional features
rsyslog: Add config files and use update-alternatives for rsyslog,
rsyslog: add DEPENDS on bison-native and flex-native
.../recipes-extended/rsyslog/rsyslog/rsyslog.conf | 84 +++++++++++++++++++ .../rsyslog/rsyslog/rsyslog.logrotate | 39 +++++++++ meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb | 88 ++++++++++++++++++-- 3 files changed, 202 insertions(+), 9 deletions(-) create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.conf create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate
Signature · 1 line
1.7.9.5
PATCH 1/4 rsyslog: use BPN to fix multilib and add all licenses
From: Jackie Huang <[email protected]>
- use BPN instead of PN to fix multilib builds
- add all three licenses
- add DESCRIPTION
--- meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb +17 -4
@@ -1,17 +1,30 @@ SUMMARY = "Rsyslog is an enhanced multi-threaded syslogd" +DESCRIPTION = "\ +Rsyslog is an enhanced syslogd supporting, among others, MySQL,\ + PostgreSQL, failover log destinations, syslog/tcp, fine grain\ + output format control, high precision timestamps, queued operations\ + and the ability to filter on any message part. 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." + DEPENDS = "zlib libestr json-c" DEPENDS += "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" HOMEPAGE = "http://www.rsyslog.com/" -LICENSE = "GPLv3" -LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973" +LICENSE = "GPLv3 & LGPLv3 & Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \ + file://COPYING.LESSER;md5=cb7903f1e5c39ae838209e130dca270a \ + file://COPYING.ASL20;md5=052f8a09206615ab07326ff8ce2d9d32\ +" -SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${PN}-${PV}.tar.gz \ +SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \ file://initscript \ " SRC_URI[md5sum] = "ebcc010a6205c28eb505c0fe862f32c6" SRC_URI[sha256sum] = "276d094d1e4c62c770ec8a72723667f119eee038912b79cf3337d439bc2f9087" - + inherit autotools pkgconfig systemd update-rc.d EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)} --enable-cached-man-pages"
Signature · 1 line
1.7.9.5
PATCH 2/4 rsyslog: add PACKAGECONFIG for optional features
In reply to [email protected]From: Jackie Huang <[email protected]>
rsyslog supports many optional features, add PACKAGECONFIG for them to ensures that the dependency on related packages is deterministic and so that we can easily enable/disable features.
--- meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb | 34 +++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb +32 -2
@@ -10,7 +10,6 @@ Rsyslog is an enhanced syslogd supporting, among others, MySQL,\ very easy to setup for the novice user." DEPENDS = "zlib libestr json-c" -DEPENDS += "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" HOMEPAGE = "http://www.rsyslog.com/" LICENSE = "GPLv3 & LGPLv3 & Apache-2.0" LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \
@@ -27,7 +26,38 @@ SRC_URI[sha256sum] = "276d094d1e4c62c770ec8a72723667f119eee038912b79cf3337d439bc inherit autotools pkgconfig systemd update-rc.d -EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)} --enable-cached-man-pages" +EXTRA_OECONF += "--enable-cached-man-pages" + +# first line is default yes in configure +PACKAGECONFIG ??= " \ + zlib rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \ + imdiag gnutls \ + ${@base_contains('DISTRO_FEATURES', 'snmp', 'snmp', '', d)} \ + ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ +" + +# default yes in configure +PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib," +PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,," +PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,," +PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,," +PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,," +PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,," +PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux," +PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt," +PACKAGECONFIG[testbench] = "--enable-testbench,--disable-testbench,," + +# default no in configure +PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,," +PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,," +PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp," +PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls," +PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd," +PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," +PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," +PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi," +PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," +PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,," do_install_append() { install -d "${D}${sysconfdir}/init.d"
Signature · 1 line
1.7.9.5
PATCH 3/4 rsyslog: Add config files and use update-alternatives for rsyslog
In reply to [email protected]From: Jackie Huang <[email protected]>
- Add a logrotate config file for rsyslog.
- Change rsyslog.conf to be compatible with sysklogd.conf.
- Use update-alternatives since we have other syslog systems:
sysklogd, busybox-syslog, etc.
--- .../recipes-extended/rsyslog/rsyslog/rsyslog.conf | 84 ++++++++++++++++++++ .../rsyslog/rsyslog/rsyslog.logrotate | 39 +++++++++ meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb | 31 +++++++- 3 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.conf create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate
meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.conf new file +84 -0
@@ -0,0 +1,84 @@ +# if you experience problems, check +# http://www.rsyslog.com/troubleshoot for assistance + +# rsyslog v3: load input modules +# If you do not load inputs, nothing happens! +# You may need to set the module load path if modules are not found. +# +# Ported from debian's sysklogd.conf + +$ModLoad immark # provides --MARK-- message capability +$ModLoad imuxsock # provides support for local system logging (e.g. via logger command) +$ModLoad imklog # kernel logging (formerly provided by rklogd) + +# +# Set the default permissions +# +$FileCreateMode 0640 +$DirCreateMode 0755 +$Umask 0022 + +auth,authpriv.* /var/log/auth.log +*.*;auth,authpriv.none -/var/log/syslog +cron.* /var/log/cron.log +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +lpr.* -/var/log/lpr.log +mail.* -/var/log/mail.log +user.* -/var/log/user.log + +# +# Logging for the mail system. Split it up so that +# it is easy to write scripts to parse these files. +# +mail.info -/var/log/mail.info +mail.warn -/var/log/mail.warn +mail.err /var/log/mail.err + +# Logging for INN news system +# +news.crit /var/log/news.crit +news.err /var/log/news.err +news.notice -/var/log/news.notice + +# +# Some `catch-all' logfiles. +# +*.=debug;\ + auth,authpriv.none;\ + news.none;mail.none -/var/log/debug +*.=info;*.=notice;*.=warn;\ + auth,authpriv.none;\ + cron,daemon.none;\ + mail,news.none -/var/log/messages + +# +# Emergencies are sent to everybody logged in. +# +*.emerg :omusrmsg:* + +# Save boot messages also to boot.log +local7.* /var/log/boot.log + +# Remote Logging (we use TCP for reliable delivery) +# An on-disk queue is created for this action. If the remote host is +# down, messages are spooled to disk and sent when it is up again. +#$WorkDirectory /var/spool/rsyslog # where to place spool files +#$ActionQueueFileName uniqName # unique name prefix for spool files +$ActionQueueMaxDiskSpace 10m # 1gb space limit (use as much as possible) +#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown +#$ActionQueueType LinkedList # run asynchronously +#$ActionResumeRetryCount -1 # infinite retries if host is down +# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional +#*.* @@remote-host:514 + + +# ######### Receiving Messages from Remote Hosts ########## +# TCP Syslog Server: +# provides TCP syslog reception and GSS-API (if compiled to support it) +#$ModLoad imtcp.so # load module +#$InputTCPServerRun 514 # start up TCP listener at port 514 + +# UDP Syslog Server: +#$ModLoad imudp.so # provides UDP syslog reception +#$UDPServerRun 514 # start a UDP syslog server at standard port 514
meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate new file +39 -0
@@ -0,0 +1,39 @@ +# /etc/logrotate.d/rsyslog - Ported from Debian + +/var/log/syslog +{ + rotate 7 + daily + missingok + notifempty + delaycompress + compress + postrotate + /etc/init.d/rsyslog reload 2> /dev/null || true + endscript +} + +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err +/var/log/mail.log +/var/log/daemon.log +/var/log/kern.log +/var/log/auth.log +/var/log/user.log +/var/log/lpr.log +/var/log/cron.log +/var/log/debug +/var/log/messages +{ + rotate 4 + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + /etc/init.d/rsyslog reload 2> /dev/null || true + endscript +}
meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb +29 -2
@@ -19,12 +19,14 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \ SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \ file://initscript \ + file://rsyslog.conf \ + file://rsyslog.logrotate \ " SRC_URI[md5sum] = "ebcc010a6205c28eb505c0fe862f32c6" SRC_URI[sha256sum] = "276d094d1e4c62c770ec8a72723667f119eee038912b79cf3337d439bc2f9087" -inherit autotools pkgconfig systemd update-rc.d +inherit autotools pkgconfig systemd update-rc.d update-alternatives EXTRA_OECONF += "--enable-cached-man-pages"
@@ -62,7 +64,8 @@ PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,," do_install_append() { install -d "${D}${sysconfdir}/init.d" install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/rsyslogd - install -m 755 ${S}/platform/redhat/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf + install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf + install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.rsyslog } FILES_${PN} += "${bindir}"
@@ -70,9 +73,33 @@ FILES_${PN} += "${bindir}" INITSCRIPT_NAME = "rsyslogd" INITSCRIPT_PARAMS = "defaults" +# higher than sysklogd's 100 +ALTERNATIVE_PRIORITY = "110" + +ALTERNATIVE_${PN} = "rsyslogd syslog-conf syslog-logrotate" + +ALTERNATIVE_LINK_NAME[rsyslogd] = "${base_sbindir}/syslogd" +ALTERNATIVE_TARGET[rsyslogd] = "${sbindir}/rsyslogd" +ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" +ALTERNATIVE_TARGET[syslog-conf] = "${sysconfdir}/rsyslog.conf" +ALTERNATIVE_LINK_NAME[syslog-logrotate] = "${sysconfdir}/logrotate.d/syslog" +ALTERNATIVE_TARGET[syslog-logrotate] = "${sysconfdir}/logrotate.rsyslog" + CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf" RPROVIDES_${PN} += "${PN}-systemd" RREPLACES_${PN} += "${PN}-systemd" RCONFLICTS_${PN} += "${PN}-systemd" SYSTEMD_SERVICE_${PN} = "${BPN}.service" + +RDEPENDS_${PN} += "logrotate" + +# no syslog-init for systemd +python () { + if 'sysvinit' in d.getVar("DISTRO_FEATURES", True).split(): + pn = d.getVar('PN', True) + sysconfdir = d.getVar('sysconfdir', True) + d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init') + d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslogd' % (sysconfdir)) + d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/rsyslogd' % (sysconfdir)) +}
Signature · 1 line
1.7.9.5
PATCH 4/4 rsyslog: add DEPENDS on bison-native and flex-native
In reply to [email protected]From: Jackie Huang <[email protected]>
--- meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb +1 -1
@@ -9,7 +9,7 @@ Rsyslog is an enhanced syslogd supporting, among others, MySQL,\ encryption protected syslog relay chains while at the same time being\ very easy to setup for the novice user." -DEPENDS = "zlib libestr json-c" +DEPENDS = "zlib libestr json-c bison-native flex-native" HOMEPAGE = "http://www.rsyslog.com/" LICENSE = "GPLv3 & LGPLv3 & Apache-2.0" LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \
Signature · 1 line
1.7.9.5