diff options
4 files changed, 47 insertions, 2 deletions
diff --git a/meta/recipes-extended/sysklogd/files/klogd.service b/meta/recipes-extended/sysklogd/files/klogd.service new file mode 100644 index 0000000000..0c888c497d --- /dev/null +++ b/meta/recipes-extended/sysklogd/files/klogd.service | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=Kernel Logging Service | ||
| 3 | After=syslogd.service | ||
| 4 | |||
| 5 | [Service] | ||
| 6 | Type=forking | ||
| 7 | ExecStart=/sbin/klogd | ||
| 8 | PIDFile=/var/run/klogd.pid | ||
| 9 | StandardOutput=null | ||
| 10 | Restart=on-failure | ||
| 11 | |||
| 12 | [Install] | ||
| 13 | WantedBy=multi-user.target | ||
diff --git a/meta/recipes-extended/sysklogd/files/syslogd.service b/meta/recipes-extended/sysklogd/files/syslogd.service new file mode 100644 index 0000000000..eeaff3d38d --- /dev/null +++ b/meta/recipes-extended/sysklogd/files/syslogd.service | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=System Logging Service | ||
| 3 | Requires=syslog.socket | ||
| 4 | |||
| 5 | [Service] | ||
| 6 | Type=forking | ||
| 7 | ExecStart=/sbin/syslogd | ||
| 8 | PIDFile=/var/run/syslogd.pid | ||
| 9 | StandardOutput=null | ||
| 10 | Restart=on-failure | ||
| 11 | |||
| 12 | [Install] | ||
| 13 | WantedBy=multi-user.target | ||
| 14 | Alias=syslog.service | ||
diff --git a/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf b/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf new file mode 100644 index 0000000000..f4aecd385b --- /dev/null +++ b/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf | |||
| @@ -0,0 +1 @@ | |||
| p /dev/xconsole 0640 root adm | |||
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 | ||
| 14 | inherit update-rc.d update-alternatives | 14 | inherit update-rc.d update-alternatives systemd |
| 15 | 15 | ||
| 16 | SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \ | 16 | SRC_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 | ||
| 23 | SRC_URI_append_e500v2 = " file://no-vectorization.patch" | 26 | SRC_URI_append_e500v2 = " file://no-vectorization.patch" |
| 24 | 27 | ||
| 28 | SYSTEMD_PACKAGES = "${PN}" | ||
| 29 | SYSTEMD_SERVICE_${PN} = "syslogd.service klogd.service" | ||
| 30 | SYSTEMD_AUTO_ENABLE = "enable" | ||
| 31 | |||
| 25 | INITSCRIPT_NAME = "syslog" | 32 | INITSCRIPT_NAME = "syslog" |
| 26 | CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${BPN}" | 33 | CONFFILES_${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 | ||
| 58 | FILES_${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 |
| 46 | ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd','10','100',d)}" | 62 | ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd','10','100',d)}" |
| 47 | 63 | ||
| 48 | ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf" | 64 | ALTERNATIVE_${PN} = "syslogd klogd syslog-conf \ |
| 65 | ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','syslog-init','',d)}" | ||
| 49 | 66 | ||
| 50 | ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd" | 67 | ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd" |
| 51 | ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd" | 68 | ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd" |
