diff options
author | Jackie Huang <jackie.huang@windriver.com> | 2014-04-21 02:21:06 -0400 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-05-03 20:45:01 +0200 |
commit | e23158541c5dc49f4f75f7e7812fe65c8c512908 (patch) | |
tree | b3ff20a69d502dab7cdcb2d240d6b7cf878402c1 /meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb | |
parent | 9ef1b542367416e2f2e418f33871f773d63a7bda (diff) | |
download | meta-openembedded-e23158541c5dc49f4f75f7e7812fe65c8c512908.tar.gz |
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 <jackie.huang@windriver.com>
Diffstat (limited to 'meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb')
-rw-r--r-- | meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb | 31 |
1 files changed, 29 insertions, 2 deletions
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 \ | |||
19 | 19 | ||
20 | SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \ | 20 | SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \ |
21 | file://initscript \ | 21 | file://initscript \ |
22 | file://rsyslog.conf \ | ||
23 | file://rsyslog.logrotate \ | ||
22 | " | 24 | " |
23 | 25 | ||
24 | SRC_URI[md5sum] = "ebcc010a6205c28eb505c0fe862f32c6" | 26 | SRC_URI[md5sum] = "ebcc010a6205c28eb505c0fe862f32c6" |
25 | SRC_URI[sha256sum] = "276d094d1e4c62c770ec8a72723667f119eee038912b79cf3337d439bc2f9087" | 27 | SRC_URI[sha256sum] = "276d094d1e4c62c770ec8a72723667f119eee038912b79cf3337d439bc2f9087" |
26 | 28 | ||
27 | inherit autotools pkgconfig systemd update-rc.d | 29 | inherit autotools pkgconfig systemd update-rc.d update-alternatives |
28 | 30 | ||
29 | EXTRA_OECONF += "--enable-cached-man-pages" | 31 | EXTRA_OECONF += "--enable-cached-man-pages" |
30 | 32 | ||
@@ -62,7 +64,8 @@ PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,," | |||
62 | do_install_append() { | 64 | do_install_append() { |
63 | install -d "${D}${sysconfdir}/init.d" | 65 | install -d "${D}${sysconfdir}/init.d" |
64 | install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/rsyslogd | 66 | install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/rsyslogd |
65 | install -m 755 ${S}/platform/redhat/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf | 67 | install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf |
68 | install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.rsyslog | ||
66 | } | 69 | } |
67 | 70 | ||
68 | FILES_${PN} += "${bindir}" | 71 | FILES_${PN} += "${bindir}" |
@@ -70,9 +73,33 @@ FILES_${PN} += "${bindir}" | |||
70 | INITSCRIPT_NAME = "rsyslogd" | 73 | INITSCRIPT_NAME = "rsyslogd" |
71 | INITSCRIPT_PARAMS = "defaults" | 74 | INITSCRIPT_PARAMS = "defaults" |
72 | 75 | ||
76 | # higher than sysklogd's 100 | ||
77 | ALTERNATIVE_PRIORITY = "110" | ||
78 | |||
79 | ALTERNATIVE_${PN} = "rsyslogd syslog-conf syslog-logrotate" | ||
80 | |||
81 | ALTERNATIVE_LINK_NAME[rsyslogd] = "${base_sbindir}/syslogd" | ||
82 | ALTERNATIVE_TARGET[rsyslogd] = "${sbindir}/rsyslogd" | ||
83 | ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" | ||
84 | ALTERNATIVE_TARGET[syslog-conf] = "${sysconfdir}/rsyslog.conf" | ||
85 | ALTERNATIVE_LINK_NAME[syslog-logrotate] = "${sysconfdir}/logrotate.d/syslog" | ||
86 | ALTERNATIVE_TARGET[syslog-logrotate] = "${sysconfdir}/logrotate.rsyslog" | ||
87 | |||
73 | CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf" | 88 | CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf" |
74 | 89 | ||
75 | RPROVIDES_${PN} += "${PN}-systemd" | 90 | RPROVIDES_${PN} += "${PN}-systemd" |
76 | RREPLACES_${PN} += "${PN}-systemd" | 91 | RREPLACES_${PN} += "${PN}-systemd" |
77 | RCONFLICTS_${PN} += "${PN}-systemd" | 92 | RCONFLICTS_${PN} += "${PN}-systemd" |
78 | SYSTEMD_SERVICE_${PN} = "${BPN}.service" | 93 | SYSTEMD_SERVICE_${PN} = "${BPN}.service" |
94 | |||
95 | RDEPENDS_${PN} += "logrotate" | ||
96 | |||
97 | # no syslog-init for systemd | ||
98 | python () { | ||
99 | if 'sysvinit' in d.getVar("DISTRO_FEATURES", True).split(): | ||
100 | pn = d.getVar('PN', True) | ||
101 | sysconfdir = d.getVar('sysconfdir', True) | ||
102 | d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init') | ||
103 | d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslogd' % (sysconfdir)) | ||
104 | d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/rsyslogd' % (sysconfdir)) | ||
105 | } | ||