From e23158541c5dc49f4f75f7e7812fe65c8c512908 Mon Sep 17 00:00:00 2001 From: Jackie Huang Date: Mon, 21 Apr 2014 02:21:06 -0400 Subject: rsyslog: Add config files and use update-alternatives for rsyslog - 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. Signed-off-by: Jackie Huang --- meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb | 31 +++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb') diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb b/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb index 3801933b5..31d2935a1 100644 --- a/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb +++ b/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb @@ -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)) +} -- cgit v1.2.3-54-g00ecf