[OE-core] [PATCH 1/1] busybox-syslog: respect /etc/syslog-startup.conf in systemd
Qi.Chen at windriver.com
Qi.Chen at windriver.com
Thu Jul 18 07:05:37 UTC 2013
From: Chen Qi <Qi.Chen at 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 at 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, at base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \
+ sed 's, at sysconfdir@,${sysconfdir},g' < ${WORKDIR}/busybox-syslog.service.in \
> ${D}${systemd_unitdir}/system/busybox-syslog.service
sed 's, at 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
More information about the Openembedded-core
mailing list