busybox & sysklogd: weigh busybox's syslogd/klogd utilities over those from sysklogd in case of systemd
cover busybox & sysklogd: weigh busybox's syslogd/klogd utilities over those from sysklogd in case of systemd
From: Chen Qi <[email protected]>
The following changes since commit c7994f83baa678a4670472e1f037bfc16cb1e3be:
bitbake: runqueue: Fix scenequeue to pass file descriptors, not a float (2013-09-02 09:16:24 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/systemd-syslog
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/systemd-syslog
Chen Qi (2):
busybox-syslog: add configuration file /etc/syslog.conf
sysklogd: lower the ALTERNATIVE_PRIORITY in case of systemd
meta/recipes-core/busybox/busybox.inc | 6 +++++- meta/recipes-core/busybox/busybox_1.21.1.bb | 1 + meta/recipes-core/busybox/files/syslog.conf | 1 + meta/recipes-extended/sysklogd/sysklogd.inc | 9 ++++++++- 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-core/busybox/files/syslog.conf
Signature · 1 line
1.7.9.5
PATCH 1/2 busybox-syslog: add configuration file /etc/syslog.conf
From: Chen Qi <[email protected]>
By default, busybox has CONFIG_FEATURE_SYSLOGD_CFG enabled, but it doesn't ship a configuration file.
This patch adds a configuration file (/etc/syslog.conf) to the busybox-syslog package. This configuration file mainly serves as a placeholder now.
The advantages of this change are:
1. Make the users aware of the fact that the /etc/syslog.conf file will actually be parsed by busybox's syslogd utility. And configuring that file will change the logging behaviour.
2. In a systemd based system, this file will prevent the same configuration file provided by the sysklogd package from messing things up.
[YOCTO #5066]
--- meta/recipes-core/busybox/busybox.inc | 6 +++++- meta/recipes-core/busybox/busybox_1.21.1.bb | 1 + meta/recipes-core/busybox/files/syslog.conf | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-core/busybox/files/syslog.conf
meta/recipes-core/busybox/busybox.inc +5 -1
@@ -21,7 +21,7 @@ export EXTRA_LDFLAGS = "${LDFLAGS}" PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock" FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www" -FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog" +FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog" FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf" FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd" FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc"
@@ -233,6 +233,7 @@ do_install () { if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${BPN} install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf.${BPN} + install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf.${BPN} fi if grep "CONFIG_CROND=y" ${B}/.config; then install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
@@ -290,6 +291,9 @@ inherit update-alternatives ALTERNATIVE_PRIORITY = "50" +ALTERNATIVE_${PN}-syslog += "syslog-conf" +ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" + python () { if 'sysvinit' in d.getVar("DISTRO_FEATURES", True).split(): pn = d.getVar('PN', True)
meta/recipes-core/busybox/busybox_1.21.1.bb +1 -0
@@ -17,6 +17,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ file://mount.busybox \ file://syslog \ file://syslog-startup.conf \ + file://syslog.conf \ file://busybox-syslog.default \ file://mdev \ file://mdev.conf \
meta/recipes-core/busybox/files/syslog.conf new file +1 -0
@@ -0,0 +1 @@ +# /etc/syslog.conf Configuration file for busybox's syslogd utility
Signature · 1 line
1.7.9.5
PATCH 2/2 sysklogd: lower the ALTERNATIVE_PRIORITY in case of systemd
In reply to [email protected]From: Chen Qi <[email protected]>
The sysklogd package hasn't got systemd support yet. So in case of a systemd based system, the commands and corresponding configuration files should have a lower priority than that of the busybox's syslogd and klogd utilities. These two utilities from busybox have internal systemd support if CONFIG_FEATURE_SYSTEMD is enabled. And that config item is enabled by default.
[YOCTO #5066]
--- meta/recipes-extended/sysklogd/sysklogd.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
meta/recipes-extended/sysklogd/sysklogd.inc +8 -1
@@ -38,7 +38,14 @@ do_install () { install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog } -ALTERNATIVE_PRIORITY = "100" +python () { + # sysklogd package has no internal systemd support, so we weigh busybox's + # sysklogd utility over it in case of systemd + if 'systemd' in d.getVar("DISTRO_FEATURES", True).split(): + d.setVar("ALTERNATIVE_PRIORITY", "10") + else: + d.setVar("ALTERNATIVE_PRIORITY", "100") +} ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
Signature · 1 line
1.7.9.5
Re: [PATCH 2/2] sysklogd: lower the ALTERNATIVE_PRIORITY in case of systemd
Quoted 23 lines · On 09/02/2013 06:40 AM, [email protected] wrote:
From: Chen Qi <[email protected]>
The sysklogd package hasn't got systemd support yet. So in case of a systemd based system, the commands and corresponding configuration files should have a lower priority than that of the busybox's syslogd and klogd utilities. These two utilities from busybox have internal systemd support if
CONFIG_FEATURE_SYSTEMDis enabled. And that config item is enabled by default.[YOCTO #5066]
Signed-off-by Chen Qi <[email protected]>--- meta/recipes-extended/sysklogd/sysklogd.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)meta/recipes-extended/sysklogd/sysklogd.inc +0
-0@@ -38,7 +38,14 @@ do_install () { install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog }
meta/recipes-extended/sysklogd/sysklogd.inc do_install () { · line 48
Quoted 10 lines
meta/recipes-extended/sysklogd/sysklogd.inc +8
-1-ALTERNATIVE_PRIORITY = "100" +python () { + # sysklogd package has no internal systemd support, so we weigh busybox's + # sysklogd utility over it in case of systemd + if 'systemd' in d.getVar("DISTRO_FEATURES", True).split(): + d.setVar("ALTERNATIVE_PRIORITY", "10") + else: + d.setVar("ALTERNATIVE_PRIORITY", "100") +}
Is there a reason an anonymous python block is better for this purpose than:
ALTERNATIVE_PRIORITY = "${@base_contains('DISTRO_FEATURES','systemd','10','100',d)}"
?
Quoted 2 lines
meta/recipes-extended/sysklogd/sysklogd.inc +0
-0ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
Re: [PATCH 2/2] sysklogd: lower the ALTERNATIVE_PRIORITY in case of systemd
Quoted 37 lines · Peter A. Bigot
Quoted 27 lines · On 09/02/2013 06:40 AM, [email protected] wrote:
From: Chen Qi <[email protected]>
The sysklogd package hasn't got systemd support yet. So in case of a systemd based system, the commands and corresponding configuration files should have a lower priority than that of the busybox's syslogd and klogd utilities. These two utilities from busybox have internal systemd support if
CONFIG_FEATURE_SYSTEMDis enabled. And that config item is enabled by default.[YOCTO #5066]
Signed-off-by Chen Qi <[email protected]>--- meta/recipes-extended/sysklogd/sysklogd.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)meta/recipes-extended/sysklogd/sysklogd.inc +2
-0@@ -38,7 +38,14 @@ do_install () { install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog } -ALTERNATIVE_PRIORITY = "100" +python () { + # sysklogd package has no internal systemd support, so we weighbusybox's
meta/recipes-extended/sysklogd/sysklogd.inc do_install () { · line 48
Quoted 6 lines
meta/recipes-extended/sysklogd/sysklogd.inc +6
-0+ # sysklogd utility over it in case of systemd + if 'systemd' in d.getVar("DISTRO_FEATURES", True).split(): + d.setVar("ALTERNATIVE_PRIORITY", "10") + else: + d.setVar("ALTERNATIVE_PRIORITY", "100") +}Is there a reason an anonymous python block is better for this purpose than:
Quoted 4 lines
ALTERNATIVE_PRIORITY= "${@base_contains('DISTRO_FEATURES','systemd','10','100',d)}"?
Thanks. I'll send out a V2.
Best Regards,
Chen Qi
Quoted 8 lines
Quoted 1 line
ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core