busybox: move syslog config to /etc/default
authorChris Larson <chris_larson@mentor.com>
Wed, 12 Jan 2011 09:43:06 +0000 (09:43 +0000)
committerChris Larson <chris_larson@mentor.com>
Mon, 17 Jan 2011 19:40:17 +0000 (12:40 -0700)
The busybox syslog syslog.conf is parsed by the /etc/init.d script, not by the
syslog process itself, so it belongs in /etc/default.  In addition, the file
format is *completely* different from the standard sysklogd configuration, so
while we should resolve the file conflict between busybox-syslog and sysklogd,
we should not use update-alternatives for it, so this is a cleaner solution.

Note: when upgrading with a modified /etc/syslog.conf, the old config will
stick around as /etc/syslog.conf-opkg.backup, and the user is then free to
move this to the new /etc/default location.  This could be automated, but we
can't risk moving a real syslog /etc/syslog.conf into the busybox config file
location, so this is best.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
recipes/busybox/busybox.inc
recipes/busybox/files/syslog

index b105337..7c38caa 100644 (file)
@@ -11,7 +11,7 @@ LICENSE = "GPLv2"
 SECTION = "base"
 PRIORITY = "required"
 
-INC_PR = "r39"
+INC_PR = "r40"
 
 SRC_URI = "\
   file://busybox-cron \
@@ -52,7 +52,8 @@ RRECOMMENDS_${PN} += "libgcc ${PN}-syslog"
 FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
 FILES_${PN}-passwd = "${sysconfdir}/passwd.${PN}"
 FILES_${PN}-shadow = "${sysconfdir}/shadow.${PN}"
-FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} ${sysconfdir}/syslog.conf"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} \
+                      ${sysconfdir}/default/busybox-syslog"
 FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
 
 FILES_${PN} += "${datadir}/udhcpc"
@@ -63,7 +64,7 @@ INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-udhcpd"
 INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
 INITSCRIPT_NAME_${PN}-syslog = "syslog"
 INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
-CONFFILES_${PN}-syslog = "${sysconfdir}/syslog.conf"
+CONFFILES_${PN}-syslog = "${sysconfdir}/default/busybox-syslog"
 
 # This disables the syslog startup links in slugos (see slugos-init)
 INITSCRIPT_PARAMS_${PN}-syslog_slugos = "start 20 ."
@@ -192,7 +193,11 @@ do_install () {
        fi
        if grep -q "CONFIG_SYSLOGD=y" ${WORKDIR}/defconfig; then
                install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${PN}
-               install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/
+               sed -i -e 's,/etc/default/busybox-syslog,${sysconfdir}/default/busybox-syslog,' \
+                   ${D}${sysconfdir}/init.d/syslog.${PN}
+
+               install -d ${D}${sysconfdir}/default
+               install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/default/busybox-syslog
        fi
        if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
                install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
index 61d273b..6e86346 100644 (file)
@@ -5,8 +5,8 @@
 #               Configuration file added by <bruno.randolf@4g-systems.biz>
 set -e
 
-if [ -f /etc/syslog.conf ]; then
-       . /etc/syslog.conf
+if [ -f /etc/default/syslog ]; then
+       . /etc/default/syslog
        LOG_LOCAL=0
        LOG_REMOTE=0
        for D in $DESTINATION; do