summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/sysklogd/sysklogd.inc
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2017-01-03 12:01:58 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-16 18:05:12 +0000
commite30f00bca5f61e9693d59e763a3dce633d76f00b (patch)
tree3f2ae58878e5f238406f080e98c45984d0d3e7e5 /meta/recipes-extended/sysklogd/sysklogd.inc
parent5ff8fdd3d676670412e9d504abbe34a635991583 (diff)
downloadpoky-e30f00bca5f61e9693d59e763a3dce633d76f00b.tar.gz
sysklogd: do more to properly work with systemd
It was noticed that syslogd and klogd were no longer running on system startup, meaning no /var/log/messages etc.. It appears as though sysklogd has never been updated to follow the expected logging requirement for systemd as described here: https://www.freedesktop.org/wiki/Software/systemd/syslog/ As such no service was started and no logging present. Using the above guidelines we create two new service files syslogd.service and klogd.service. We make use of tmpfiles.d in order to ensure the xconsole device node exists and do other minor recipe cleanup to ensure peaceful coexistence with sysvinit and systemd implementations. The systemd documentation also asks that for a logger which is not rsyslog that we also enable 'ForwardToSyslog=' in journald.conf, but this is already the case so no action is required. With this change in place syslogd and klogd are started at system startup and the expected logs are available. Unfortunately I was not able to find any work done on this upstream or in other distros so this is my best effort at making this work. (From OE-Core rev: 914e08cf627e54e5019eda2154663c30b9a68ded) Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/sysklogd/sysklogd.inc')
-rw-r--r--meta/recipes-extended/sysklogd/sysklogd.inc21
1 files changed, 19 insertions, 2 deletions
diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc b/meta/recipes-extended/sysklogd/sysklogd.inc
index 5c15ffe8ab..f9af0a4833 100644
--- a/meta/recipes-extended/sysklogd/sysklogd.inc
+++ b/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -11,17 +11,24 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
11 file://klogd.c;beginline=2;endline=19;md5=7e87ed0ae6142de079bce738c10c899d \ 11 file://klogd.c;beginline=2;endline=19;md5=7e87ed0ae6142de079bce738c10c899d \
12 " 12 "
13 13
14inherit update-rc.d update-alternatives 14inherit update-rc.d update-alternatives systemd
15 15
16SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \ 16SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \
17 file://no-strip-install.patch \ 17 file://no-strip-install.patch \
18 file://0001-Fix-build-with-musl.patch \ 18 file://0001-Fix-build-with-musl.patch \
19 file://sysklogd \ 19 file://sysklogd \
20 file://syslog.conf \ 20 file://syslog.conf \
21 file://syslogd.service \
22 file://klogd.service \
23 file://tmpfiles.sysklogd.conf \
21 " 24 "
22 25
23SRC_URI_append_e500v2 = " file://no-vectorization.patch" 26SRC_URI_append_e500v2 = " file://no-vectorization.patch"
24 27
28SYSTEMD_PACKAGES = "${PN}"
29SYSTEMD_SERVICE_${PN} = "syslogd.service klogd.service"
30SYSTEMD_AUTO_ENABLE = "enable"
31
25INITSCRIPT_NAME = "syslog" 32INITSCRIPT_NAME = "syslog"
26CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${BPN}" 33CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${BPN}"
27 34
@@ -39,13 +46,23 @@ do_install () {
39 install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf 46 install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
40 install -d ${D}${sysconfdir}/init.d 47 install -d ${D}${sysconfdir}/init.d
41 install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog 48 install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
49 install -d ${D}${systemd_unitdir}/system
50 install -m 644 ${WORKDIR}/syslogd.service ${D}${systemd_unitdir}/system
51 install -m 644 ${WORKDIR}/klogd.service ${D}${systemd_unitdir}/system
52 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true', 'false', d)}; then
53 install -d ${D}${exec_prefix}/lib/tmpfiles.d
54 install -m 644 ${WORKDIR}/tmpfiles.sysklogd.conf ${D}${exec_prefix}/lib/tmpfiles.d/sysklogd.conf
55 fi
42} 56}
43 57
58FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/sysklogd.conf', '', d)}"
59
44# sysklogd package has no internal systemd support, so we weigh busybox's 60# sysklogd package has no internal systemd support, so we weigh busybox's
45# sysklogd utility over it in case of systemd 61# sysklogd utility over it in case of systemd
46ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd','10','100',d)}" 62ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd','10','100',d)}"
47 63
48ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf" 64ALTERNATIVE_${PN} = "syslogd klogd syslog-conf \
65 ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','syslog-init','',d)}"
49 66
50ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd" 67ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd"
51ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd" 68ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd"