* [PATCH 1/2] busybox: don't manage sysv init script with update-alternatives
2016-11-21 15:07 [PATCH 0/2] Stop using update-alternatives to manage syslog init script Markus Lehtonen
@ 2016-11-21 15:07 ` Markus Lehtonen
2016-11-21 15:07 ` [PATCH 2/2] sysklogd: don't use update-alternatives Markus Lehtonen
1 sibling, 0 replies; 3+ messages in thread
From: Markus Lehtonen @ 2016-11-21 15:07 UTC (permalink / raw)
To: openembedded-core
This has proved to be a bad idea. Some package srciptlet
(preinst/postinst/prerm/postrm) seems to break whatever we try to do.
Basically the failures happend because the expeceted init script is not
present when the scriptlet tries to run update-rc.d or start or stop the
service. Another indication that it is a bad idea is that no other
system service package seems to manage init scripts with
update-alternatives.
The patch also adds a new virtual package, i.e. VIRTUAL-RUNTIME_syslog.
[YOCTO #10433]
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
meta/conf/distro/include/default-providers.inc | 1 +
meta/recipes-core/busybox/busybox.inc | 26 +++++++-------------------
2 files changed, 8 insertions(+), 19 deletions(-)
diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
index ece4d8b..b1d245f 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -28,6 +28,7 @@ VIRTUAL-RUNTIME_getopt ?= "util-linux-getopt"
VIRTUAL-RUNTIME_wireless-tools ?= "iw wireless-tools"
VIRTUAL-RUNTIME_base-utils ?= "busybox"
VIRTUAL-RUNTIME_base-utils-hwclock ?= "busybox-hwclock"
+VIRTUAL-RUNTIME_syslog ?= "busybox-syslog"
#
# Default recipe providers
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index b2f1960..cbcff9e 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -23,6 +23,8 @@ EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${
PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
+RCONFLICTS_${PN}-syslog = "sysklogd"
+
FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
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 ${sysconfdir}/mdev/*"
@@ -45,7 +47,7 @@ SYSTEMD_SERVICE_${PN}-syslog = "busybox-syslog.service"
CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf.${BPN}"
CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
-RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
+RRECOMMENDS_${PN} = "${VIRTUAL-RUNTIME_syslog} ${PN}-udhcpc"
inherit cml1 systemd update-rc.d ptest
@@ -238,9 +240,9 @@ do_install () {
fi
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}
+ install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog
+ install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf
+ install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
fi
if grep "CONFIG_CROND=y" ${B}/.config; then
install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
@@ -312,7 +314,7 @@ do_install () {
# Remove the sysvinit specific configuration file for systemd systems to avoid confusion
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then
- rm -f ${D}${sysconfdir}/syslog-startup.conf.${BPN}
+ rm -f ${D}${sysconfdir}/syslog-startup.conf
fi
}
@@ -326,20 +328,6 @@ inherit update-alternatives
ALTERNATIVE_PRIORITY = "50"
-ALTERNATIVE_${PN}-syslog += "syslog-conf"
-ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
-
-python () {
- if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
- pn = d.getVar('PN', True)
- d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-init')
- d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (d.getVar('sysconfdir', True)))
- d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
- d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-startup-conf')
- d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-startup-conf', '%s/syslog-startup.conf' % (d.getVar('sysconfdir', True)))
- d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-startup-conf', '%s/syslog-startup.conf.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
-}
-
python do_package_prepend () {
# We need to load the full set of busybox provides from the /etc/busybox.links
# Use this to see the update-alternatives with the right information
--
2.6.6
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 2/2] sysklogd: don't use update-alternatives
2016-11-21 15:07 [PATCH 0/2] Stop using update-alternatives to manage syslog init script Markus Lehtonen
2016-11-21 15:07 ` [PATCH 1/2] busybox: don't manage sysv init script with update-alternatives Markus Lehtonen
@ 2016-11-21 15:07 ` Markus Lehtonen
1 sibling, 0 replies; 3+ messages in thread
From: Markus Lehtonen @ 2016-11-21 15:07 UTC (permalink / raw)
To: openembedded-core
Using update-alternatives for managing init scripts has proved to be
problematic. Thus, don't use this method and just conflict with
busybox-syslog, instead.
[YOCTO #10433]
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
meta/recipes-extended/sysklogd/sysklogd.inc | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc b/meta/recipes-extended/sysklogd/sysklogd.inc
index 5c15ffe..de47e08 100644
--- a/meta/recipes-extended/sysklogd/sysklogd.inc
+++ b/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
file://klogd.c;beginline=2;endline=19;md5=7e87ed0ae6142de079bce738c10c899d \
"
-inherit update-rc.d update-alternatives
+inherit update-rc.d
SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \
file://no-strip-install.patch \
@@ -22,6 +22,8 @@ SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar
SRC_URI_append_e500v2 = " file://no-vectorization.patch"
+RCONFLICTS_${PN} = "busybox-syslog"
+
INITSCRIPT_NAME = "syslog"
CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${BPN}"
@@ -41,17 +43,6 @@ do_install () {
install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
}
-# sysklogd package has no internal systemd support, so we weigh busybox's
-# sysklogd utility over it in case of systemd
-ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd','10','100',d)}"
-
-ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
-
-ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd"
-ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd"
-ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog"
-ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
-
pkg_prerm_${PN} () {
if test "x$D" = "x"; then
if test "$1" = "upgrade" -o "$1" = "remove"; then
--
2.6.6
^ permalink raw reply related [flat|nested] 3+ messages in thread