Skip to contentSkip to conversation

busybox: move syslog config to /etc/default

PATCH In review Chris Larson 6 participants 9 messages Jan 12, 2011 – Jan 20, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 busybox: move syslog config to /etc/default

From: Chris Larson <[email protected]>

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.

---
 recipes/busybox/busybox.inc  |   13 +++++++++----
 recipes/busybox/files/syslog |    4 ++--
 2 files changed, 11 insertions(+), 6 deletions(-)
recipes/busybox/busybox.inc +9 -4
index a9d1e6e..1106910 100644
@@ -11,7 +11,7 @@ LICENSE = "GPLv2"
 SECTION = "base"
 PRIORITY = "required"
 
-INC_PR = "r38"
+INC_PR = "r39"
 
 SRC_URI = "\
   file://busybox-cron \
@@ -47,7 +47,8 @@ RDEPENDS_${PN} += "${PN}-mountall"
 RRECOMMENDS_${PN} += "libgcc ${PN}-syslog"
 
 FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
-FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} ${sysconfdir}/syslog.conf"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} \
+                      ${sysconfdir}/default/syslog"
 FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
 
 FILES_${PN} += "${datadir}/udhcpc"
@@ -58,7 +59,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/syslog"
 
 # This disables the syslog startup links in slugos (see slugos-init)
 INITSCRIPT_PARAMS_${PN}-syslog_slugos = "start 20 ."
@@ -168,7 +169,11 @@ do_install () {
 
 	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/syslog,${sysconfdir}/default/syslog,' \
+	            ${D}${sysconfdir}/init.d/syslog.${PN}
+
+		install -d ${D}${sysconfdir}/default
+		install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/default/syslog
 	fi
 	if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
 		install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
recipes/busybox/files/syslog +2 -2
index 61d273b..6e86346 100644
@@ -5,8 +5,8 @@
 #               Configuration file added by <[email protected]>
 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
Signature · 1 line
1.7.2.3
Acked-by on v1 1/1
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12-01-11 02:43, Chris Larson wrote:

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFNLVkQMkyGM64RGpERAsvJAJ0X3LKCZa/UGKCEyhi8ZVqm2H2hogCfeZEL 0BTGsNqRWq/HzGg/TXA1lrY=
=a4z6
-----END PGP SIGNATURE-----

Acked-by on v1 1/1
#2 lore raw
In reply to Chris Larson
Quoted 9 lines · Chris Larson

From: Chris Larson<[email protected]>

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.

looks ok will upgrade paths work ok after this change

Quoted 65 lines
---
  recipes/busybox/busybox.inc  |   13 +++++++++----
  recipes/busybox/files/syslog |    4 ++--
  2 files changed, 11 insertions(+), 6 deletions(-)
recipes/busybox/busybox.inc +9 -4
index a9d1e6e..1106910 100644
@@ -11,7 +11,7 @@ LICENSE = "GPLv2"
  SECTION = "base"
  PRIORITY = "required"
 
-INC_PR = "r38"
+INC_PR = "r39"
 
  SRC_URI = "\
    file://busybox-cron \
@@ -47,7 +47,8 @@ RDEPENDS_${PN} += "${PN}-mountall"
  RRECOMMENDS_${PN} += "libgcc ${PN}-syslog"
 
  FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
-FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} ${sysconfdir}/syslog.conf"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} \
+                      ${sysconfdir}/default/syslog"
  FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
 
  FILES_${PN} += "${datadir}/udhcpc"
@@ -58,7 +59,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/syslog"
 
  # This disables the syslog startup links in slugos (see slugos-init)
  INITSCRIPT_PARAMS_${PN}-syslog_slugos = "start 20 ."
@@ -168,7 +169,11 @@ do_install () {
 
  	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/syslog,${sysconfdir}/default/syslog,' \
+	            ${D}${sysconfdir}/init.d/syslog.${PN}
+
+		install -d ${D}${sysconfdir}/default
+		install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/default/syslog
  	fi
  	if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
  		install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
recipes/busybox/files/syslog +2 -2
index 61d273b..6e86346 100644
@@ -5,8 +5,8 @@
  #               Configuration file added by<[email protected]>
  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
#3 lore raw
Quoted 15 lines · Khem Raj
Quoted 14 lines · Chris Larson

From: Chris Larson<[email protected]>

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.

Quoted 5 lines
Quoted 1 line

looks ok will upgrade paths work ok after this change

Hmm, I suspect that if the user modified the busybox /etc/syslog.conf, opkg would leave their version behind with a different filename, rather than blindly removing a user edited conffile, but of course the new one in /etc/default wouldn't include any of the old user customizations. I'll look into this a bit more closely. Thanks.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
Acked-by on v1 1/1
#4 lore raw
In reply to Chris Larson

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 9 lines · Chris Larson

From: Chris Larson <[email protected]>

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.

Quoted 55 lines
---
 recipes/busybox/busybox.inc  |   13 +++++++++----
 recipes/busybox/files/syslog |    4 ++--
 2 files changed, 11 insertions(+), 6 deletions(-)
recipes/busybox/busybox.inc +9 -4
index a9d1e6e..1106910 100644
@@ -11,7 +11,7 @@ LICENSE = "GPLv2"
 SECTION = "base"
 PRIORITY = "required"
 
-INC_PR = "r38"
+INC_PR = "r39"
 
 SRC_URI = "\
   file://busybox-cron \
@@ -47,7 +47,8 @@ RDEPENDS_${PN} += "${PN}-mountall"
 RRECOMMENDS_${PN} += "libgcc ${PN}-syslog"
 
 FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
-FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} ${sysconfdir}/syslog.conf"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} \
+                      ${sysconfdir}/default/syslog"
 FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
 
 FILES_${PN} += "${datadir}/udhcpc"
@@ -58,7 +59,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/syslog"
 
 # This disables the syslog startup links in slugos (see slugos-init)
 INITSCRIPT_PARAMS_${PN}-syslog_slugos = "start 20 ."
@@ -168,7 +169,11 @@ do_install () {
 
 	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/syslog,${sysconfdir}/default/syslog,' \
+	            ${D}${sysconfdir}/init.d/syslog.${PN}
+
+		install -d ${D}${sysconfdir}/default
+		install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/default/syslog
 	fi
 	if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
 		install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
recipes/busybox/files/syslog +0 -0
index 61d273b..6e86346 100644

recipes/busybox/files/syslog line 12

Quoted 10 lines
recipes/busybox/files/syslog +2 -2
@@ -5,8 +5,8 @@
 #               Configuration file added by <[email protected]>
 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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFNLVkQMkyGM64RGpERAsvJAJ9WbhU0dw3A3KhaBElGnWOD7kR00ACgjCOC XnbydKbwxeyr+YooJQoOYpg=
=evbp
-----END PGP SIGNATURE-----

#5 lore raw
In reply to Chris Larson

Am 12.01.2011 02:43, schrieb Chris Larson:

Quoted 7 lines

From: Chris Larson <[email protected]>

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.

Moving the file into /etc/default seems to be OK for me.

But i would suggest to rename the config file itself to busybox-syslog, because it does not contain (default) configuration for any syslog incarnation but only for busybox-syslog.

Steffen

Signature · 8 lines
Steffen Sledz
DResearch Digital Media Systems GmbH
Otto-Schmirgal-Str.3, D-10319 Berlin, Germany
Tel: +49 (30) 515932237 mailto:[email protected]
Fax: +49 (30) 515932299 http://www.DResearch.DE
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 54412;
Ust.-IDNr. DE169013825; WEEE Reg.-Nr. DE 85995642
#6 lore raw
Quoted 9 lines · Steffen Sledz

Am 12.01.2011 02:43, schrieb Chris Larson:

Quoted 7 lines

From: Chris Larson <[email protected]>

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.

Quoted 3 lines

Moving the file into /etc/default seems to be OK for me.

But i would suggest to rename the config file itself to busybox-syslog, because it does not contain (default) configuration for any syslog incarnation but only for busybox-syslog.

Good point, will do. Thanks.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
#7 lore raw
In reply to Chris Larson
Quoted 48 lines · Chris Larson

From: Chris Larson <[email protected]>

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.

---
 recipes/busybox/busybox.inc  |   13 +++++++++---- recipes/busybox/files/syslog |    4 ++--

 2 files changed, 11 insertions(+), 6 deletions(-)
recipes/busybox/busybox.inc +0 -0
index a9d1e6e..1106910 100644
@@ -11,7 +11,7 @@ LICENSE = "GPLv2"

 SECTION = "base"
 PRIORITY = "required"

recipes/busybox/busybox.inc +1 -1
-INC_PR = "r38"
+INC_PR = "r39"

 SRC_URI = "\
  file://busybox-cron \

recipes/busybox/busybox.inc +0 -0
@@ -47,7 +47,8 @@ RDEPENDS_${PN} += "${PN}-mountall"

 RRECOMMENDS_${PN} += "libgcc ${PN}-syslog"

 FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"

recipes/busybox/busybox.inc +2 -1
-FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} ${sysconfdir}/syslog.conf"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} \
+                      ${sysconfdir}/default/syslog"

 FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"

 FILES_${PN} += "${datadir}/udhcpc"

recipes/busybox/busybox.inc +0 -0
@@ -58,7 +59,7 @@ INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-udhcpd"

 INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
 INITSCRIPT_NAME_${PN}-syslog = "syslog"
 INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"

recipes/busybox/busybox.inc +1 -1
-CONFFILES_${PN}-syslog = "${sysconfdir}/syslog.conf"
+CONFFILES_${PN}-syslog = "${sysconfdir}/default/syslog"

 # This disables the syslog startup links in slugos (see slugos-init) INITSCRIPT_PARAMS_${PN}-syslog_slugos = "start 20 ."

recipes/busybox/busybox.inc +0 -0
@@ -168,7 +169,11 @@ do_install () {
 
Quoted 5 lines

       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/syslog,${sysconfdir}/default/syslog,' \
+                   ${D}${sysconfdir}/init.d/syslog.${PN}

Hi,

Here it's right but to OE you've pushed version of patch where it is also renamed to
default/busybox-syslog, but that patern in sed call 's,/etc/default/busybox-syslog,' should still read 's,/etc/default/syslog,', otherwise nothing is replaced and syslog.busybox is still trying to read /etc/default/syslog which does not exist

or rename it to busybox-syslog in files/syslog file too
http://git.openembedded.org/cgit.cgi/openembedded/commit/recipes/busybox/files/syslog?id=a25c0750c7892990c59e8d6048b8c4d99410bcee

Regards,

+ sed -i -e
's,/etc/default/busybox-syslog,${sysconfdir}/default/busybox-syslog,' \
+ ${D}${sysconfdir}/init.d/syslog.${PN}

Quoted 32 lines

+

+               install -d ${D}${sysconfdir}/default
+               install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/default/syslog fi
       if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
               install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/

recipes/busybox/files/syslog +0 -0
index 61d273b..6e86346 100644
@@ -5,8 +5,8 @@
  #               Configuration file added by <[email protected]>

 set -e

recipes/busybox/files/syslog +2 -2
-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
--
1.7.2.3

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#8 lore raw
Quoted 11 lines · Martin Jansa

Here it's right but to OE you've pushed version of patch where it is also renamed to
default/busybox-syslog, but that patern in sed call 's,/etc/default/busybox-syslog,' should still read 's,/etc/default/syslog,', otherwise nothing is replaced and syslog.busybox is still trying to read /etc/default/syslog which does not exist

or rename it to busybox-syslog in files/syslog file too
http://git.openembedded.org/cgit.cgi/openembedded/commit/recipes/busybox/files/syslog?id=a25c0750c7892990c59e8d6048b8c4d99410bcee

Bah, damnit, thanks. Well spotted.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics