[OE-core] [PATCH] sysklogd: add a delay before klogd connect syslogd

Randy MacLeod randy.macleod at windriver.com
Thu Jan 9 02:03:55 UTC 2020


On 1/8/20 2:33 AM, yanfei.xu at windriver.com wrote:
> From: Yanfei Xu <yanfei.xu at windriver.com>
>
> klogd and syslogd's type has been changed from "forking" to "simple"
> in service file used by systemd. It causes klogd will boot on the
> heels of syslogd in a very short time and result in a empty kern.log.
>
> Adding a delay before klogd connecting syslogd can solve this.
> --------------------------
> steps to reproduce:
>      Bitbake core-image-minimal  with configuration as follow:
>      MACHINE ??= "genericx86-64"
>      DISTRO_FEATURES_append = " systemd"
>      VIRTUAL-RUNTIME_init_manager = "systemd"
>      VIRTUAL-RUNTIME_base-utils-syslog = "sysklogd"
>
> After your system booting successfully, you will find /var/log/kern.log
> is empty.
> -------------------------
>
> Signed-off-by: Yanfei Xu <yanfei.xu at windriver.com>
> ---
>   meta/recipes-extended/sysklogd/sysklogd.inc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc b/meta/recipes-extended/sysklogd/sysklogd.inc
> index 774d23b..ff8188d 100644
> --- a/meta/recipes-extended/sysklogd/sysklogd.inc
> +++ b/meta/recipes-extended/sysklogd/sysklogd.inc
> @@ -21,7 +21,7 @@ SRC_URI = "git://github.com/troglobit/sysklogd.git;nobranch=1 \
>              "
>   S = "${WORKDIR}/git"
>   
> -EXTRA_OECONF = "--with-systemd=${systemd_system_unitdir} --with-klogd --without-logger"
> +EXTRA_OECONF = "--with-systemd=${systemd_system_unitdir} --with-klogd --with-klogd-delay=1 --without-logger"
>   
>   do_install_append () {
>          install -d ${D}${sysconfdir}

This might be a sensible work-around for the 3.0/zeus releaese but
for the master branch it is not acceptable.

A delay is often a work-around especially if it's a round number like 1 
second.
A slower machine may not be fixed by a 2 second delay and so we'd be
tempted to delay 2 or 10 seconds, soon enough your system is only fully
initialized after a fortnight. ;-)

Also and more importantly we should be looking at what upstream is doing and
for sysklogd, they are _removing_ klogd:

https://github.com/troglobit/sysklogd/commits/6bb6672ebf797078d1c31c83dcf960f767808557

     Remove klogd from the sysklogd project

	This patch removes one of the traditionally key pieces of the sysklogd
	project, klogd.  Now that syslogd performs logging of kernel messages
	we no longer require a separate daemon for that.

	Signed-off-by: Joachim Nilsson <troglobit at gmail.com>


The question to answer is, do all the syslog daemons:
  - syslogd
  - rsyslogd
  - systemd/journald
  - others?
have the support that we klogd provides.
-- 
# Randy MacLeod
# Wind River Linux

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20200108/5789f022/attachment.html>


More information about the Openembedded-core mailing list