summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
authorAndy Ross <andy.ross@windriver.com>2012-10-11 09:22:55 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-18 12:13:48 +0100
commit4445ffe1f3a8de417c930a30177a91b89a7dede4 (patch)
tree3955b0cf1a88a5ddc9c29e44ed91ce856f7511cb /meta/recipes-extended
parent789ebb54982e7217330cf871189170f64fe6a07c (diff)
downloadpoky-4445ffe1f3a8de417c930a30177a91b89a7dede4.tar.gz
sysklogd: fix update-rc.d handling
The sysklogd recipe had a cut-n-paste version of the update-rc.d.bbclass code which didn't work, but this was hidden because all images contain the busybox version which does. Building a busybox-free image unmasked the issue and syslogd wouldn't start on first boot. The comments seem to be wrong/stale. AFAICT update-rc.d and update-alternatives work fine with each other, though there is an ordering constraint (alternatives must be specified last, so it "wraps" update-rc.d). This version builds and works both with and without busybox. (From OE-Core rev: 644673631bf57bd8d0e152b5fe7621344b5ad24f) Signed-off-by: Andy Ross <andy.ross@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/sysklogd/sysklogd.inc43
1 files changed, 1 insertions, 42 deletions
diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc b/meta/recipes-extended/sysklogd/sysklogd.inc
index 151babb34a..11673283f6 100644
--- a/meta/recipes-extended/sysklogd/sysklogd.inc
+++ b/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -11,10 +11,7 @@ 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# syslog initscript is handled explicitly because order of 14inherit update-rc.d update-alternatives
15# update-rc.d and update-alternatives is important (see below)
16DEPENDS_append = " update-rc.d update-rc.d-native"
17RDEPENDS_${PN}_append = " update-rc.d"
18 15
19SRC_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 \
20 file://no-strip-install.patch \ 17 file://no-strip-install.patch \
@@ -41,22 +38,6 @@ do_install () {
41 install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog 38 install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
42} 39}
43 40
44pkg_preinst_${PN} () {
45 # all this is needed to avoid sysmlink errors,
46 # because update-rc.d runs before pkg_postinst
47 ETC=$D${sysconfdir}
48
49 if [ -e $ETC/init.d/syslog -a ! -L $ETC/init.d/syslog ]; then
50 echo "WARNING:" "non symlink ${sysconfdir}/init.d/syslog exist -> backup to ${sysconfdir}/init.d/syslog.old"
51 mv $ETC/init.d/syslog $ETC/init.d/syslog.old
52 fi
53 if [ ! -e $ETC/init.d/syslog ]; then
54 ln -s dummy $ETC/init.d/syslog
55 fi
56}
57
58inherit update-alternatives
59
60ALTERNATIVE_PRIORITY = "100" 41ALTERNATIVE_PRIORITY = "100"
61 42
62ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf" 43ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
@@ -66,15 +47,6 @@ ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd"
66ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog" 47ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog"
67ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" 48ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
68 49
69pkg_postinst_${PN} () {
70 if test "x$D" != "x"; then
71 OPT="-r $D"
72 else
73 OPT="-s"
74 fi
75 update-rc.d $OPT syslog defaults
76}
77
78pkg_prerm_${PN} () { 50pkg_prerm_${PN} () {
79 if test "x$D" = "x"; then 51 if test "x$D" = "x"; then
80 if test "$1" = "upgrade" -o "$1" = "remove"; then 52 if test "$1" = "upgrade" -o "$1" = "remove"; then
@@ -82,16 +54,3 @@ pkg_prerm_${PN} () {
82 fi 54 fi
83 fi 55 fi
84} 56}
85
86pkg_postrm_${PN} () {
87 if test "x$D" != "x"; then
88 OPT="-r $D"
89 else
90 OPT=""
91 fi
92 if test "$1" = "remove" -o "$1" = "purge"; then
93 if ! test -e "/etc/init.d/syslog"; then
94 update-rc.d $OPT syslog remove
95 fi
96 fi
97}