aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/rsyslog
diff options
context:
space:
mode:
authorSteffen Sledz <sledz@dresearch.de>2010-05-07 16:15:57 +0200
committerSteffen Sledz <sledz@dresearch.de>2010-05-17 14:08:13 +0200
commit543d057b7dc9290130a89226b567f2b2140aae0c (patch)
tree926ecfbca3a7f1b687285de2ad7645bfb2b3824f /recipes/rsyslog
parent98bed2876d7dd88cc25f1c70929f1d632b8f95ee (diff)
downloadopenembedded-543d057b7dc9290130a89226b567f2b2140aae0c.tar.gz
openembedded-543d057b7dc9290130a89226b567f2b2140aae0c.tar.bz2
openembedded-543d057b7dc9290130a89226b567f2b2140aae0c.zip
busybox/syslogs: use update-alternatives for syslog selection
* u-a for init scripts of busybox-syslog, sysklogd, and rsyslog * syslog-ng needs to be integrated too! Signed-off-by: Steffen Sledz <sledz@dresearch.de> Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes/rsyslog')
-rw-r--r--recipes/rsyslog/rsyslog.inc50
1 files changed, 40 insertions, 10 deletions
diff --git a/recipes/rsyslog/rsyslog.inc b/recipes/rsyslog/rsyslog.inc
index 3e39ba0a04..d94ab34d3b 100644
--- a/recipes/rsyslog/rsyslog.inc
+++ b/recipes/rsyslog/rsyslog.inc
@@ -2,31 +2,61 @@ DESCRIPTION = "Rsyslog is an enhanced multi-threaded syslogd"
DEPENDS = "zlib"
HOMEPAGE = "http://www.rsyslog.com/"
LICENSE = "GPLv3"
-INC_PR = "r0"
+INC_PR = "r1"
SRC_URI = "http://download.rsyslog.com/rsyslog/${PN}-${PV}.tar.gz \
file://rsyslog.conf \
file://initscript"
-inherit autotools update-rc.d
+
+inherit autotools
do_install_append() {
install -d ${D}/${sysconfdir}/${PN}
install ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
install -d ${D}/${sysconfdir}/init.d
- install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/rsyslog
+ install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${PN}
+}
+
+# syslog initscript is handled explicitly because order of
+# update-rc.d and update-alternatives is important
+DEPENDS_append = " update-rc.d update-rc.d-native"
+RDEPENDS_${PN}_append = " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}"
+
+pkg_postinst_${PN} () {
+ update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 300
+
+ if test "x$D" != "x"; then
+ OPT="-r $D"
+ else
+ OPT="-s"
+ fi
+ update-rc.d $OPT syslog defaults
}
-pkg_postinst() {
- update-rc.d -f syslog remove
+pkg_prerm_${PN} () {
+ if test "x$D" = "x"; then
+ if test "$1" = "upgrade" -o "$1" = "remove"; then
+ /etc/init.d/syslog stop
+ fi
+ fi
+
+ update-alternatives --remove syslog-init syslog.${PN}
}
-pkg_postrm() {
- update-rc.d syslog add 5
+pkg_postrm_${PN} () {
+ if test "x$D" != "x"; then
+ OPT="-r $D"
+ else
+ OPT=""
+ fi
+ if test "$1" = "remove" -o "$1" = "purge"; then
+ if ! test -e "/etc/init.d/syslog"; then
+ update-rc.d $OPT syslog remove
+ fi
+ fi
}
CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf"
-INITSCRIPT_NAME = "rsyslog"
-#INITSCRIPT_PARAMS = "defaults 05"
-INITSCRIPT_PARAMS = "remove"
+INITSCRIPT_NAME = "syslog"