All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Qi.Chen@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Cc: qingtao.cao@windriver.com
Subject: [PATCH 1/1] busybox-syslog: respect /etc/syslog-startup.conf in systemd
Date: Thu, 18 Jul 2013 15:05:37 +0800	[thread overview]
Message-ID: <7a265612fe08a636afc61a659ac5fadd22b0a7bd.1374116641.git.Qi.Chen@windriver.com> (raw)
In-Reply-To: <cover.1374116641.git.Qi.Chen@windriver.com>

From: Chen Qi <Qi.Chen@windriver.com>

Now we've used busybox-syslog as a replacement for systemd's syslog
service. Currently, there are two problems.

1. The configuration file, /etc/syslog-startup.conf, is ignored.
   This is really confusing, as we are used to the behaviour of
   changing the configuration in /etc/syslog-startup.conf for the
   syslog service. This is actually a weekly test case.
2. The /etc/init.d/syslog is installed, but it has no real usage in
   systemd based systems.

This patch solves the above two problems by changing the busybox-syslog.
service file to let the /etc/init.d/syslog script start syslog service.
The /etc/init.d/syslog file is actually a wrapper in this situation.

[YOCTO #4860]
[YOCOT #4837]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/busybox/busybox.inc              |    2 +-
 .../busybox/files/busybox-syslog.service.in        |    3 +--
 meta/recipes-core/busybox/files/syslog             |    7 +++++++
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index acd2bfb..1095be6 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -267,7 +267,7 @@ do_install () {
 
     if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
         install -d ${D}${systemd_unitdir}/system
-        sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \
+        sed 's,@sysconfdir@,${sysconfdir},g' < ${WORKDIR}/busybox-syslog.service.in \
             > ${D}${systemd_unitdir}/system/busybox-syslog.service
         sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-klogd.service.in \
             > ${D}${systemd_unitdir}/system/busybox-klogd.service
diff --git a/meta/recipes-core/busybox/files/busybox-syslog.service.in b/meta/recipes-core/busybox/files/busybox-syslog.service.in
index 2e04321..f849a61 100644
--- a/meta/recipes-core/busybox/files/busybox-syslog.service.in
+++ b/meta/recipes-core/busybox/files/busybox-syslog.service.in
@@ -3,8 +3,7 @@ Description=System Logging Service
 Wants=busybox-klogd.service
 
 [Service]
-EnvironmentFile=-/etc/default/busybox-syslog
-ExecStart=@base_sbindir@/syslogd -n $OPTIONS
+ExecStart=@sysconfdir@/init.d/syslog systemd
 Sockets=syslog.socket
 
 [Install]
diff --git a/meta/recipes-core/busybox/files/syslog b/meta/recipes-core/busybox/files/syslog
index 2944d3d..98eda80 100644
--- a/meta/recipes-core/busybox/files/syslog
+++ b/meta/recipes-core/busybox/files/syslog
@@ -68,6 +68,13 @@ case "$1" in
   	$0 stop
 	$0 start
 	;;
+  systemd)
+	# This action is only for systemd based images. It's kind of ugly here.
+	# But as we're using busybox-syslog as the syslog service in systemd images,
+	# and we want to respect the configurations in /etc/syslog-startup.conf,
+	# this is an easy way to achieve this goal without duplicating codes.
+	/sbin/syslogd -n $SYSLOG_ARGS
+	;;
   *)
 	echo "Usage: syslog { start | stop | restart }" >&2
 	exit 1
-- 
1.7.9.5



  reply	other threads:[~2013-07-18  7:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18  7:05 [PATCH 0/1] busybox-syslog: respect /etc/syslog-startup.conf in systemd Qi.Chen
2013-07-18  7:05 ` Qi.Chen [this message]
2013-07-18 17:07   ` [PATCH 1/1] " Burton, Ross
2013-07-19  1:59     ` ChenQi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a265612fe08a636afc61a659ac5fadd22b0a7bd.1374116641.git.Qi.Chen@windriver.com \
    --to=qi.chen@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=qingtao.cao@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.